Re: Loading views from external nibs?
Re: Loading views from external nibs?
- Subject: Re: Loading views from external nibs?
- From: "Carlos A. Weber" <email@hidden>
- Date: Sat, 20 Jul 2002 14:55:52 -1000
On Friday, Jul 19, 2002, at 07:33 Pacific/Honolulu, Andrew Merenbach wrote:
I took a look (I have no idea that those particular IB sample projects existed). Unfortunately, the sample projects don't seem to give any information about loading just views (ie, items of class NSView, not NSWindow).
A nib can contain JUST a view and not a window. You need a subclass of NSView and a controller class, probably a subclass of NSObject. In IB you drag a CustomView object from the palette onto the desktop, just as you would drag a window object. Use the Info Panel to set the custom view as your NSView subclass. You can then prefab your view by dragging other widgets into it, etc. The code to instantiate it is then analogous to that found in the SimpleMultiWindow example. Of course you have to insert the view into the view hierarchy of your main window; that's fairly well explained in the NSView documentation.
_______________________________________________
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.