Re: Using a subclass in IB
Re: Using a subclass in IB
- Subject: Re: Using a subclass in IB
- From: Sam Griffith <email@hidden>
- Date: Sat, 09 Nov 2002 22:53:21 -0600
Edward,
Two ways:
1) If your going to create the subclass using IB.
Create your interface with the supplied widgets. Next, select the textField
you want to actually be an instance of a new subclass. In the .nib view,
switch to the classes tab. You should see the NSTextField class selected.
From the Classes menu choose "Subclass NSTextField". This will create a
subclass called MyTextField. (You can rename it if you want) You then add
outlets and actions using the info panel. Then you go back to the classes
menu and choose "Create Files for MyTextField". Now you have a subclass and
its files to put code into. Now, with the textfield instance selected, go
to the info panel and choose "Custom Class" from the drop down and you
should see your new class listed. Select it and save the nib.
@) If you've already got the subclass files. Then you go the Class menu and
choose "Read files...". Then choose your subclass files. Then go to the
NIB window and switch to the classes tab and find your subclass. (this is
just to make sure it loaded in). Next, you go ahead and create your GUI with
an instance of NSTextField on it. Then you select the text field and go to
the info panel and from the drop down, choose custom class. You should see
your subclass in the list. Choose it.
Save your file.
Hope this helps....
--
Sam Griffith Jr.
email: email@hidden
Web site:
http://homepage.mac.com/staypufd/index.html
On 11/09/2002 2:01 PM, "Edward Fink" <email@hidden> wrote:
>
Hi,
>
>
Once I have created a subclass of an NSTextField or an
>
NSTextView.....how exactly do I then use it in Interface Builder?
>
>
Thanks
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.