mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-24 06:28:54 +00:00
In [insertItemWithTitle:atIndex:] use action and target from the
cell for menu item. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10803 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3a950b8cae
commit
ef5ec4b497
1 changed files with 6 additions and 8 deletions
|
@ -182,7 +182,7 @@ static NSImage *_pbc_image[2];
|
|||
|
||||
- (void) insertItemWithTitle: (NSString *)title atIndex: (int)index
|
||||
{
|
||||
NSMenuItem *anItem = [NSMenuItem new];
|
||||
NSMenuItem *anItem;
|
||||
NSMenuItemCell *aCell;
|
||||
int count = [_menu numberOfItems];
|
||||
|
||||
|
@ -191,13 +191,11 @@ static NSImage *_pbc_image[2];
|
|||
if (index > count)
|
||||
index = count;
|
||||
|
||||
[anItem setTitle: title];
|
||||
[anItem setTarget: nil];
|
||||
[anItem setAction: NULL];
|
||||
|
||||
[_menu insertItem: anItem atIndex: index];
|
||||
|
||||
RELEASE(anItem);
|
||||
anItem = [_menu insertItemWithTitle: title
|
||||
action: [self action]
|
||||
keyEquivalent: @""
|
||||
atIndex: index];
|
||||
[anItem setTarget: [self target]];
|
||||
|
||||
aCell = [[_menu menuRepresentation] menuItemCellForItemAtIndex: index];
|
||||
[aCell setBelongsToPopUpButton: YES];
|
||||
|
|
Loading…
Reference in a new issue