Created
January 17, 2011 22:25
-
-
Save statonjr/783613 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In this case, we want the window from Cib to become our full browser window | |
[theWindow setFullBridge:YES]; | |
// Instantiate the LayoutManager | |
[LayoutManager sharedManager]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: document | |
var SharedLayoutManager = nil; | |
@implementation LayoutManager : CPObject | |
{ | |
} | |
+ (LayoutManager) sharedManager | |
{ | |
if (!SharedLayoutManager) { | |
SharedLayoutManager = [[LayoutManager alloc] init]; | |
// LayoutManager listens for CPWindowShouldCloseNotification | |
// Each window controller must implement this to have its window saved | |
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(saveWindowInfo:) name:@"CPWindowShouldCloseNotification" object:nil]; | |
} | |
return SharedLayoutManager; | |
} | |
- (id)init | |
{ | |
return SharedLayoutManager; | |
} | |
+ (void)saveWindowInfo:(CPNotification)aNotification | |
{ | |
// This window data is in [aNotification object] | |
console.log("[LayoutManager saveWindowInfo] window closing: ", [aNotification object]); | |
// TODO: Save window data to server | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)windowShouldClose:(id)aWindow | |
{ | |
if (timer) { | |
[timer invalidate]; | |
[currentTimeTimer invalidate]; | |
[aWindow close]; | |
} | |
// WindowController posts this notification for LayoutManager and sends the window as the object | |
[[CPNotificationCenter defaultCenter] postNotificationName:@"CPWindowShouldCloseNotification" object:aWindow]; | |
SharedSymbolQuickViewWindowController = nil; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment