• 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: NSPanel newbie init question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPanel newbie init question


  • Subject: Re: NSPanel newbie init question
  • From: Luc Vandal <email@hidden>
  • Date: Mon, 25 Apr 2005 22:15:23 -0400

One thing I forgot to mention is that the window I'm trying to display already exists in the nib file (it has controls, etc.). I don't want to create a window but rather display the one that is already defined...

:)


On 25-Apr-05, at 10:11 PM, Luc Vandal wrote:

Hi!

I guess I was not clear enough :(

I just want to know how to create an instance of a derived NSPanel (NSWindow or whatever) and display it. When it's an IBOutlet (within a NSWindowController), it's initialized by the controller (I assume) so I can use the instance later on. I don't want that. I want to be able to create an instance, initialize it and display it within a function scope.

This code doesn't work. All it does is display a small window:

MyPanel* wnd = [[MyPanel alloc] init];

//Run modal loop
NSModalSession nDlgBrowseSession = [NSApp beginModalSessionForWindow: wnd];


int nRes = 0;


[NSApp runModalSession:nDlgBrowseSession];
for (;;)
{
nRes = [NSApp runModalSession:nDlgBrowseSession];


if ( nRes != NSRunContinuesResponse)
break;
}


Thanks!

Luc


On 25-Apr-05, at 9:00 PM, Dave Rehring wrote:

On 4/25/05 5:29 PM, Luc Vandal at email@hidden wrote:

currently my NSPanels are initialized automatically since they are
IBOutlets. I don't know how to create the panel on the fly. I've tried this
but it only shows a small, blank panel:

Right, it did what you asked.

You created a panel, and asked the system to display it. That's what
happened.

You might want to investigate adding NSButton's to the panel next...

Depending on what you want for the panel's contents, you might also consider
NSAlert...

Later,
--
David Rehring Psychos do not explode when light hits
VP of Research and Development them, no matter how crazy they are...
Atimi Software, Inc.
www.atimi.com And totally insane guy!


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: NSPanel newbie init question (From: Dave Rehring <email@hidden>)
 >Re: NSPanel newbie init question (From: Luc Vandal <email@hidden>)

  • Prev by Date: Re: NSPanel newbie init question
  • Next by Date: bind, unbind and retainCount problems
  • Previous by thread: Re: NSPanel newbie init question
  • Next by thread: Document notifications?
  • Index(es):
    • Date
    • Thread