i have created class toolpanelcontroller
subclass of nswindowcontroller
, .xib file named toolpanel when start app toolpanel don't show up. file's owner class set toolpanelcontroller panel delegate file's owner , window connected file's owner. how can set panel show when app starts running?
toolpanelcontroller.h:
#import <cocoa/cocoa.h> @interface toolpanelcontroller : nswindowcontroller { iboutlet nspanel *toolpanel; } + (id)sharedtoolpalettecontroller; @end
toolpanelcontroller.m:
#import "toolpanelcontroller.h" @interface toolpanelcontroller () @end @implementation toolpanelcontroller + (id)sharedtoolpalettecontroller { static toolpanelcontroller *sharedtoolpalettecontroller = nil; if (!sharedtoolpalettecontroller) { sharedtoolpalettecontroller = [[toolpanelcontroller allocwithzone:null] init]; } return sharedtoolpalettecontroller; } - (id)initwithwindow:(nswindow *)window { self = [self initwithwindownibname:@"toolpanel"]; if (self) { [self setwindowframeautosavename:@"toolpanel"]; [(nspanel *)[self window] orderfront:self]; } return self; } - (void)windowdidload { [super windowdidload]; // implement method handle initialization after window controller's window has been loaded nib file. } @end
Comments
Post a Comment