Created
August 11, 2010 02:16
-
-
Save smokyonion/518375 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#import "MyPanelController.h" | |
@implementation MyPanelController | |
- (MyPanelController *)init | |
{ | |
return [super initWithWindowNibName:@"MyPanel"]; | |
} | |
- (void)awakeFromNib | |
{ | |
// Autosave Window Frame | |
NSWindow *window = [self window]; | |
// Tell the controller to not cascade its windows. | |
[[window windowController] setShouldCascadeWindows:NO]; | |
// Specify the autosave name for the window. | |
[window setFrameAutosaveName:@"com.smokyonion.MyPanelFrameAutosaveName"]); | |
} | |
- (void)toggleMyPanel:(id)sender | |
{ | |
NSWindow *window = [self window]; | |
if([window isVisible]) | |
[window orderOut:sender]; | |
else | |
[window orderFront:sender]; | |
} | |
- (IBAction)closeMyPanel:(id)sender | |
{ | |
[[self window] close]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment