Implemented NSMenu removeAllItems method

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@37996 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2014-07-14 20:08:26 +00:00
parent 21ffab74f8
commit 61695272c5
3 changed files with 22 additions and 0 deletions

View file

@ -829,6 +829,15 @@ static BOOL menuBarVisible = YES;
[self menuChanged];
}
- (void) removeAllItems
{
[_items makeObjectsPerformSelector:@selector(setMenu:) withObject:nil];
[_items removeAllObjects];
_menu.needsSizing = YES;
[(NSMenuView*)_view setNeedsSizing: YES];
[self menuChanged];
}
- (void) itemChanged: (id <NSMenuItem>)anObject
{
NSNotification *changed;
@ -1563,6 +1572,10 @@ static BOOL menuBarVisible = YES;
forView: (NSView *)view
withFont: (NSFont *)font
{
NSPoint point = [view frame].origin;
point = [[view superview] convertPoint:point toView:nil];
point = [[view window] convertBaseToScreen: point];
// [[menu window] setFrameOrigin:point];
[menu _rightMouseDisplay: event];
}