mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 12:31:55 +00:00
(removeAllItems): Leave item at index 0 with empty title
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16444 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
69ed1dbdcf
commit
490b673918
1 changed files with 4 additions and 2 deletions
|
@ -202,10 +202,11 @@ static NSImage *_pbc_image[2];
|
||||||
|
|
||||||
- (void) removeAllItems
|
- (void) removeAllItems
|
||||||
{
|
{
|
||||||
while ([_menu numberOfItems] > 0)
|
while ([_menu numberOfItems] > 1)
|
||||||
{
|
{
|
||||||
[_menu removeItemAtIndex: 0];
|
[_menu removeItemAtIndex: 0];
|
||||||
}
|
}
|
||||||
|
[[_menu itemAtIndex: 0] setTitle: @""];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accessing the items
|
// Accessing the items
|
||||||
|
@ -512,7 +513,8 @@ static NSImage *_pbc_image[2];
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Get the NSMenuItemCell of the selected item */
|
/* Get the NSMenuItemCell of the selected item */
|
||||||
aCell = [[_menu menuRepresentation] menuItemCellForItemAtIndex: [self indexOfSelectedItem]];
|
aCell = [[_menu menuRepresentation]
|
||||||
|
menuItemCellForItemAtIndex: [self indexOfSelectedItem]];
|
||||||
|
|
||||||
/* Turn off highlighting so the NSPopUpButton looks right */
|
/* Turn off highlighting so the NSPopUpButton looks right */
|
||||||
[aCell setHighlighted: NO];
|
[aCell setHighlighted: NO];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue