Having trouble just displaying a window
Having trouble just displaying a window
- Subject: Having trouble just displaying a window
- From: Rick Mann <email@hidden>
- Date: Wed, 14 Nov 2007 22:33:14 -0800
I'm not sure where I originally found this example, but I can't seem
to make it work. I use the following code to implement an inspector
NSPanel that hides and shows each time the menu item is chosen.
@implementation STXAppDelegate
- (IBAction)
showChartInspector: (id) inSender
{
if (mChartInspectorController == NULL)
{
mChartInspectorController = [[NSWindowController alloc]
initWithWindowNibName: @"ChartInspector"];
[mChartInspectorController setWindowFrameAutosaveName:
@"ChartInspector"];
}
[mChartInspectorController showOrHideWindow];
}
.
.
.
I can put a breakpoint there, and trace it into:
- (void)
showOrHideWindow
{
if ([self isWindowShown])
{
[[self window] orderOut: self]; // Hide the window
}
else
{
[self showWindow: self]; // Show the window
}
}
it executes [self showWindow: self], but no window appears.
I'm new to Cocoa, but this seems straightforward. What might I be
missing?
TIA,
Rick
_______________________________________________
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