(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:
Sergii Stoian 2003-04-12 11:12:31 +00:00
parent 69ed1dbdcf
commit 490b673918

View file

@ -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];