Something truly fundamental I must be missing...
Something truly fundamental I must be missing...
- Subject: Something truly fundamental I must be missing...
- From: Joel Sherriff <email@hidden>
- Date: Wed, 10 Sep 2008 18:51:46 -0400
I've been writing in Cocoa for a whopping 4-5 days now and have yet to
be able to do anything without help...not sure what that says about me
or Cocoa. But at any rate, here I go again...
I've written an app that works just fine, but now I want to add a dialog
that displays when I want it to (doesn't open at app launch). Right
now, the window won't display when I want it to...won't display at all
for that matter. I'm hoping if I snippets of the key pieces here,
someone can see where I've gone off track.
BTW, the window is an NSPanel, if that matters.
Here's the snippet from my app that's supposed to create, init, and show
my window:
//Dialog *dialog = [[Dialog alloc] init]; // Set it all running.
//[dialog orderFront:dialog];
DialogController* dialog=[[DialogController alloc] init];
[dialog showDialog];
CFRunLoopRun();
As you can see, I've tried creating the Dialog object itself, and the
managing Controller class...no joy in either case. I feel like the
issue is somewhere in the .nib file - some missing wiring which of
course is impossible to display here, but maybe showing snippets of the
.h and .m files will show what I've left out.
----------------------------------------------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
----------------------------------------------Dialog.m:------------------------------------
#import "Dialog.h"
@implementation Dialog
- (void) popup {
orderFront:self;
}
@end
----------------------------------------------Dialog.h:------------------------------------
#import <Cocoa/Cocoa.h>
@interface Dialog : NSPanel {
}
- (void) popup;
@end
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden