mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
Minor tidyup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5256 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6561a2fbfb
commit
34dec557da
3 changed files with 24 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Nov 22 14:51:33:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSApplication.m: Start listening for window notifications
|
||||
in initialisation.
|
||||
|
||||
1999-11-21 Tim McIntosh <rockford@novia.net>
|
||||
|
||||
* Model/GMAppKit.m ([NSMenuItem -initWithModelUnarchiver:]),
|
||||
|
|
|
@ -378,6 +378,8 @@ static NSCell* tileCell = nil;
|
|||
|
||||
- (id) init
|
||||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
|
||||
if (NSApp != nil && NSApp != self)
|
||||
{
|
||||
RELEASE(self);
|
||||
|
@ -410,6 +412,19 @@ static NSCell* tileCell = nil;
|
|||
|
||||
/* We are the end of responder chain */
|
||||
[self setNextResponder: nil];
|
||||
|
||||
/* Register self as observer to window events. */
|
||||
[nc addObserver: self selector: @selector(_windowWillClose:)
|
||||
name: NSWindowWillCloseNotification object: nil];
|
||||
[nc addObserver: self selector: @selector(_windowDidBecomeKey:)
|
||||
name: NSWindowDidBecomeKeyNotification object: nil];
|
||||
[nc addObserver: self selector: @selector(_windowDidBecomeMain:)
|
||||
name: NSWindowDidBecomeMainNotification object: nil];
|
||||
[nc addObserver: self selector: @selector(_windowDidResignKey:)
|
||||
name: NSWindowDidResignKeyNotification object: nil];
|
||||
[nc addObserver: self selector: @selector(_windowDidResignMain:)
|
||||
name: NSWindowDidResignMainNotification object: nil];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -452,18 +467,6 @@ static NSCell* tileCell = nil;
|
|||
|
||||
[self activateIgnoringOtherApps: YES];
|
||||
|
||||
/* Register self as observer to window events. */
|
||||
[nc addObserver: self selector: @selector(_windowWillClose:)
|
||||
name: NSWindowWillCloseNotification object: nil];
|
||||
[nc addObserver: self selector: @selector(_windowDidBecomeKey:)
|
||||
name: NSWindowDidBecomeKeyNotification object: nil];
|
||||
[nc addObserver: self selector: @selector(_windowDidBecomeMain:)
|
||||
name: NSWindowDidBecomeMainNotification object: nil];
|
||||
[nc addObserver: self selector: @selector(_windowDidResignKey:)
|
||||
name: NSWindowDidResignKeyNotification object: nil];
|
||||
[nc addObserver: self selector: @selector(_windowDidResignMain:)
|
||||
name: NSWindowDidResignMainNotification object: nil];
|
||||
|
||||
/* finish the launching post notification that launching has finished */
|
||||
[nc postNotificationName: NSApplicationDidFinishLaunchingNotification
|
||||
object: self];
|
||||
|
|
|
@ -673,6 +673,10 @@ static NSMapTable* windowmaps = NULL;
|
|||
|
||||
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin
|
||||
{
|
||||
if (_f.is_key == YES && place == NSWindowOut)
|
||||
{
|
||||
[self resignKeyWindow];
|
||||
}
|
||||
DPSorderwindow(GSCurrentContext(), place, otherWin, [self windowNumber]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue