Preferences Panel: No Progress
Preferences Panel: No Progress
- Subject: Preferences Panel: No Progress
- From: Albion Baucom <email@hidden>
- Date: Fri, 16 Jul 2004 12:31:05 -0700 (PDT)
Im still getting no where with this one. Help.
This is a document based application, so the NSWindowController stuff is a
little more complicated.
1. I can't get a preferences panel to display. I created a preferences
panel in IB, and made its file owner "Preferences". I have a Preferences.m
and Preferences.h file in my Xcode project. I created an outlet for a
NSWindowController (preferencesPanelController), and an outlet for a
NSPanel (preferencesPanel) and connected them via IB in the Preferences
NIB, and the preferences menu option in my MainMenu NIB.
(follow-up: I have checked, double checked my connections. I looked at the
developer example TextEdit that has a preferences panel, and the
"accessory" window example in my Learning Objective-C with Cocoa book).
So, when I try to open the preferences via the menu option, I see that my
method is called; "showPanel called" is printed, but the panel never
appears. I don't get an error, I have tried inside and out of the if()
statement checking if the preferencesPanelController has been
instantiated, and the NSLog shows a healthy NSWindowController object.
My Preferences.nib file lives in the same directory in the project as the
MainMenu.nib file, and I never get an error that the NIB failed to load.
Here is the showPanel code that I have connected to the "Preferences ..."
menu option
- (IBAction)showPanel:(id)sender
{
printf("showPanel called\n");
if(!preferencesPanelController)
{
if (![NSBundle loadNibNamed:@"Preferences" owner:self])
{
NSLog(@"Failed to load Preferences.nib");
NSBeep();
return;
}
preferencesPanelController = [[NSWindowController alloc]
initWithWindow:preferencesPanel];
NSLog(@"preferencesPanelController %@",
preferencesPanelController);
}
[preferencesPanelController showWindow:self];
}
Could this be opening offscreen?? There is simply no errors generated, and
this code on the first call prints this
showPanel called
2004-07-16 12:26:27.888 MOViewer[557] preferencesPanelController
<NSWindowController: 0x147c9d0>
and on subsequent calls I get just this
showPanel called
All is normal, EXCEPT THAT THE WINDOW NEVER IS DISPLAYED! Ahhh. I have
spent a lot of time trying to figure this one out. I may just start a test
project to see if I can write code to make any window appear. The examples
work fine, but I can't find the difference between their code and mine
(either in Xcode or IB).
What am I missing?!
Thanks
Albion
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.