Re: programmaticaly modify .nib files
Re: programmaticaly modify .nib files
- Subject: Re: programmaticaly modify .nib files
- From: "Frank D. Engel, Jr." <email@hidden>
- Date: Fri, 6 May 2005 11:13:32 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On May 6, 2005, at 10:47 AM, Nick Zitzmann wrote:
I think I figured out how to load the NIB file (using the NSNib and
NSBundle classes),
All you need to do is use the +[NSBundle loadNibNamed:owner:] method.
I was using a different one, but that seems to make sense considering
the below; so then do I give that class outlets I can assign the
dialogs (NSPanel objects) to, and assigning the owner using that method
determines which object of that class gets access to them?
Okay, I'll try that. Sounds good.
but how do I actually get a reference for a specific dialog within
the NIB file? There are four different versions of the dialog, and I
want to display a different one depending on the parameters sent to
the method.
You need to set the owner in the nib file by choosing the "File's
owner" object and setting a custom class in the info window. If the
nib contains a window, then you should consider subclassing
NSWindowController and setting the owner to the subclass.
NSWindowController has built-in nib loading methods.
But what are you putting into the dialog? If it's just a simple
message and OK/Cancel/Don't Save/etc. window, then you should instead
consider using the NSAlert class.
I used the NSAlert class for the only dialog of this type in the
framework, which is a custom database-access framework. The dialogs
are variations on a login dialog, offering username and password
fields, and several others, depending on the situation (thus four
versions of the dialog).
Thank you!
- -----------------------------------------------------------
Frank D. Engel, Jr. <email@hidden>
$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten
Son, that whosoever believeth in him should not perish, but have
everlasting life.
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCe4md7aqtWrR9cZoRAgcnAJ9W7Ng2yma3GzLiLUqSRZmhKaiYjQCgkdxj
El/Rm5lZXOCM7Ue8sWB+fYw=
=a9kY
-----END PGP SIGNATURE-----
___________________________________________________________
$0 Web Hosting with up to 200MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com
_______________________________________________
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