mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:50:48 +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
19a411023b
commit
4ebfd91996
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
|
- (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];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue