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:
FredKiefer 2001-08-30 06:50:38 +00:00
parent 19a411023b
commit 4ebfd91996

View file

@ -182,7 +182,7 @@ static NSImage *_pbc_image[2];
- (void) insertItemWithTitle: (NSString *)title atIndex: (int)index - (void) insertItemWithTitle: (NSString *)title atIndex: (int)index
{ {
NSMenuItem *anItem = [NSMenuItem new]; NSMenuItem *anItem;
NSMenuItemCell *aCell; NSMenuItemCell *aCell;
int count = [_menu numberOfItems]; int count = [_menu numberOfItems];
@ -191,13 +191,11 @@ static NSImage *_pbc_image[2];
if (index > count) if (index > count)
index = count; index = count;
[anItem setTitle: title]; anItem = [_menu insertItemWithTitle: title
[anItem setTarget: nil]; action: [self action]
[anItem setAction: NULL]; keyEquivalent: @""
atIndex: index];
[_menu insertItem: anItem atIndex: index]; [anItem setTarget: [self target]];
RELEASE(anItem);
aCell = [[_menu menuRepresentation] menuItemCellForItemAtIndex: index]; aCell = [[_menu menuRepresentation] menuItemCellForItemAtIndex: index];
[aCell setBelongsToPopUpButton: YES]; [aCell setBelongsToPopUpButton: YES];