• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Having trouble just displaying a window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Having trouble just displaying a window (From: Rick Mann <email@hidden>)

  • Prev by Date: [newbie][Core Data] Code-side filled data not shown in Table
  • Next by Date: Re: forward class warning
  • Previous by thread: Re: Having trouble just displaying a window
  • Next by thread: Re: Having trouble just displaying a window
  • Index(es):
    • Date
    • Thread