On Sep 10, 2008, at 3:51 PM, Joel Sherriff wrote:
---------------------------------------------- DialogController.m:------------------------------------#import DialogController.h @implementation DialogController - (id) init { self = [super init]; return self; } - (void) showDialog { [Dialog orderFront:self]; } @end---------------------------------------------- DialogController.h:------------------------------------#import <Cocoa/Cocoa.h> @interface DialogController : NSObject { IBOutlet NSPanel* Dialog; } - (void) showDialog; @end
Make the DialogController a subclass of NSWindowController and implement -init: as follows:
-(id)init {self = [super initWithWindowNibName:@"<DialogNibHere>"]; <<<<--- Nib Filename without extension
if (self) { // custom initialization here } return self; }In Interface Builder, make sure you set class of the File's Owner object of the nib file to DialogController. Also in IB, set the window outlet of the File's Owner object to your panel (after setting the class name).
This assumes that your dialog is in a separate nib, not in the main menu nib file.
Regards Markus -- __________________________________________ Markus Spoettl
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]