Re: Having trouble just displaying a window
Re: Having trouble just displaying a window
- Subject: Re: Having trouble just displaying a window
- From: Rick Mann <email@hidden>
- Date: Thu, 15 Nov 2007 00:05:44 -0800
On Nov 14, 2007, at 11:11 PM, Hal Mueller wrote:
What class have you written -showOrHideWindow on? Is
mChartInspectorController an instance of some subclass of
NSWindowController? What is the value of window when -
showOrHideWindow is called ( NSLog(@"window: %@", window); )?
Oh! the window is null:
2007-11-14 23:36:37.599 SatTrackX[14201:813] window: (null)
Sorry, I don't yet know enough about NSWindowController to know why it
doesn't show. I have a .xib file named ChartInspector.xib, and the
window inside that is named "ChartInspector". Nice of Cocoa to let me
know why it's not loading...
showOrHideWindow is added to NSWindowController in the file before the
inspector window's controller is allocated:
@interface NSWindowController(STXConvenience)
- (BOOL) isWindowShown;
- (void) showOrHideWindow;
@end
@implementation NSWindowController(STXConvenience)
- (BOOL)
isWindowShown
{
return [[self window] isVisible];
}
- (void)
showOrHideWindow
{
if ([self isWindowShown])
{
[[self window] orderOut: self]; // Hide the window
}
else
{
[self showWindow: self]; // Show the window
}
}
@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