diff --git a/AppKit/NSWindow.m b/AppKit/NSWindow.m index d7510431..fcc576a1 100755 --- a/AppKit/NSWindow.m +++ b/AppKit/NSWindow.m @@ -79,6 +79,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification return 0; } +/* This method is Cococtron specific and can be override by subclasses, do not change method name */ +(BOOL)hasMainMenuForStyleMask:(NSUInteger)styleMask { if(styleMask&NSTitledWindowMask) return YES; @@ -86,6 +87,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification return NO; } +/* This method is Cococtron specific and can be override by subclasses, do not change method name. */ -(BOOL)hasMainMenu { return [isa hasMainMenuForStyleMask:_styleMask]; } @@ -145,6 +147,10 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification return [NSThemeFrame class]; } +-init { + return [self initWithContentRect:NSMakeRect(100,100,100,100) styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO]; +} + -initWithCoder:(NSCoder *)coder { [NSException raise:NSInvalidArgumentException format:@"-[%@ %s] is not implemented for coder %@",isa,sel_getName(_cmd),coder]; return self; diff --git a/AppKit/nib.subproj/NSWindowTemplate.m b/AppKit/nib.subproj/NSWindowTemplate.m index a6263468..b5237d16 100644 --- a/AppKit/nib.subproj/NSWindowTemplate.m +++ b/AppKit/nib.subproj/NSWindowTemplate.m @@ -36,7 +36,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI _windowAutosave=[[keyed decodeObjectForKey:@"NSFrameAutosaveName"] retain]; _windowRect.origin.y -= _screenRect.size.height - [[NSScreen mainScreen] frame].size.height; - if ([_windowClass hasMainMenuForStyleMask:_windowStyleMask]) + if ([NSClassFromString(_windowClass) hasMainMenuForStyleMask:_windowStyleMask]) _windowRect.origin.y -= [NSMainMenuView menuHeight]; // compensation for the additional menu bar } else {