Update menu code and set menu on window creation.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29373 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2010-01-23 23:41:07 +00:00
parent f59546bebf
commit 15de26b03c
5 changed files with 49 additions and 17 deletions

View file

@ -983,6 +983,8 @@ many times.
screen: (NSScreen*)aScreen
{
NSRect cframe;
NSInterfaceStyle style =
NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil);
NSAssert(NSApp,
@"The shared NSApplication instance must be created before windows "
@ -1056,6 +1058,14 @@ many times.
name: NSColorListChangedNotification
object: nil];
if (style == NSWindows95InterfaceStyle)
{
if([self canBecomeMainWindow])
{
[self setMenu: [NSApp mainMenu]];
}
}
NSDebugLLog(@"NSWindow", @"NSWindow end of init\n");
return self;
}
@ -2300,8 +2310,19 @@ many times.
}
}
- (void) update
- (void) _menuUpdate
{
NSInterfaceStyle style =
NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil);
if(style == NSWindows95InterfaceStyle)
{
//[[GSTheme theme] updateMenu: [self menu] forWindow: self];
}
}
- (void) update
{
[self _menuUpdate];
[nc postNotificationName: NSWindowDidUpdateNotification object: self];
}