Author: paullanders
Date: Thu Jul 30 20:31:15 2015
New Revision: 38849
URL: http://svn.gna.org/viewcvs/gnustep?rev=38849&view=rev
Log:
Fixed NSMenu removeAllItems to also remove the cell views.
Modified:
libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSMenuView.h
libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m
libs/gui/branches/gnustep_testplant_branch/Source/NSMenuView.m
Modified: libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSMenuView.h
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSMenuView.h?rev=38849&r1=38848&r2=38849&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSMenuView.h
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Headers/AppKit/NSMenuView.h
Thu Jul 30 20:31:15 2015
@@ -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
***********************************************************************/
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m?rev=38849&r1=38848&r2=38849&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m (original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSMenu.m Thu Jul 30
20:31:15 2015
@@ -839,6 +839,7 @@
[_items removeAllObjects];
_menu.needsSizing = YES;
[(NSMenuView*)_view setNeedsSizing: YES];
+ [(NSMenuView*)_view allItemsRemoved];
[self menuChanged];
}
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSMenuView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSMenuView.m?rev=38849&r1=38848&r2=38849&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSMenuView.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSMenuView.m Thu Jul
30 20:31:15 2015
@@ -554,6 +554,16 @@
{
[self setHighlightedItemIndex: --wasHighlighted];
}
+ // Mark the menu view as needing to be resized.
+ [self setNeedsSizing: YES];
+ [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];
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs