per-window menu setting tweaks.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27686 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-01-25 13:47:30 +00:00
parent 246576a001
commit ab54f4450e
8 changed files with 100 additions and 35 deletions

View file

@ -26,6 +26,7 @@
#include "GSWindowDecorationView.h"
#include <Foundation/NSEnumerator.h>
#include <Foundation/NSException.h>
#include "AppKit/NSColor.h"
@ -417,14 +418,26 @@
[self changeWindowHeight: menubarHeight];
}
- (void) removeMenuView: (NSMenuView*)menuView
- (NSMenuView*) removeMenuView
{
float menubarHeight = [NSMenuView menuBarHeight];
NSEnumerator *e = [[self subviews] objectEnumerator];
NSView *v;
// Unplug the menu view
[menuView removeFromSuperviewWithoutNeedingDisplay];
while ((v = [e nextObject]) != nil)
{
if ([v isKindOfClass: [NSMenuView class]] == YES)
{
float menubarHeight = [NSMenuView menuBarHeight];
/* Unplug the menu view and return it so that it can be
* restored to its original menu if necessary.
*/
[RETAIN(v) removeFromSuperviewWithoutNeedingDisplay];
[self changeWindowHeight: -menubarHeight];
[self changeWindowHeight: -menubarHeight];
return AUTORELEASE(v);
}
}
}
@end