mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Fixed NSMenu removeAllItems to also remove the cell views.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38849 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e72f28bd58
commit
91919e85d1
3 changed files with 17 additions and 0 deletions
|
@ -249,6 +249,12 @@
|
|||
*/
|
||||
- (void) itemRemoved: (NSNotification *)notification;
|
||||
|
||||
/**
|
||||
Removes all cells, removes highlighting, marks cell and menu view as
|
||||
needing to be resized.
|
||||
*/
|
||||
- (void) allItemsRemoved;//: (NSNotification *)notification;
|
||||
|
||||
/***********************************************************************
|
||||
* Working with submenus
|
||||
***********************************************************************/
|
||||
|
|
|
@ -839,6 +839,7 @@ static BOOL menuBarVisible = YES;
|
|||
[_items removeAllObjects];
|
||||
_menu.needsSizing = YES;
|
||||
[(NSMenuView*)_view setNeedsSizing: YES];
|
||||
[(NSMenuView*)_view allItemsRemoved];
|
||||
[self menuChanged];
|
||||
}
|
||||
|
||||
|
|
|
@ -559,6 +559,16 @@ static float menuBarHeight = 0.0;
|
|||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
|
||||
- (void) allItemsRemoved
|
||||
{
|
||||
[self setHighlightedItemIndex: -1];
|
||||
[_itemCells removeAllObjects];
|
||||
|
||||
// Mark the menu view as needing to be resized.
|
||||
[self setNeedsSizing: YES];
|
||||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
|
||||
/*
|
||||
* Working with Submenus.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue