Re: Having trouble just displaying a window
Re: Having trouble just displaying a window
- Subject: Re: Having trouble just displaying a window
- From: Sam Stigler <email@hidden>
- Date: Thu, 15 Nov 2007 00:19:48 -0800
First off, why are you using your own method for -isWindowShown?
NSWindow (which NSPanel inherits from) provides several methods to
make the window (or panel) visible. See http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html
.
-Sam
On Nov 14, 2007, at 10:33 PM, Rick Mann wrote:
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
_______________________________________________
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