Re: creating and using a View xib
Re: creating and using a View xib
- Subject: Re: creating and using a View xib
- From: Jerry Isdale <email@hidden>
- Date: Tue, 10 Jun 2008 23:47:31 -0700
I understand and appreciate the use of a XIB vs NIB, but that doesnt
help me understand how to use either.
When I build a XIB/NIB containing a (custom) View + controller, how do
I incorporate that into other views and windows?
In ObjC code for that other view/window controller? How does it get
placed properly?
I thought that was what Interface Builder was for - to compose the
interface.
My sample XIB/NIB now contains:
File's Owner
First Responder
Application
XX Control View
XX Gui Controller
the XX Control View is an NSView that holds a box with a bunch of
buttons.
the XX Gui Controller was dragged in from the Library as an NSObject
and changed to point to my XXGuiControll class.
I hooked up all the various Buttons and Text Fields to IBOutlets in
the Controller.
It makes a tidy sub-panel that I now want to put into a corner of a
larger view, which will be a tab in the app window.
I had thought there would be a way to use IB to place the view into
the window (or tabs).
Now I think that is incorrect, and I will need to programmatically
load the nib file and place its contents in the window somehow.
On Jun 10, 2008, at 5:21 PM, Graham Cox wrote:
A .xib file is just a .nib file in a text format, so it is more
compatible with svn. Xcode compiles the .xib into a .nib. So to edit
one, use Interface Builder as usual.
because a .xib *is* a .nib, you load it as you do a nib -
loadNibNamed:owner: You don't have to do anything different from
what you would normally.
G.
On 11 Jun 2008, at 10:00 am, Jerry Isdale wrote:
I'm building up a rather complex UI and would like to design,
build, test portions of it as stand alone applications (esp so I
can pass subsections to others to build). Initially I started
building the apps by creating new Cocoa apps in Xcode3 and using IB
to tweak up the MainMenu.xib with Controllers. That worked really
nice - quick easy, shows the power of the tools. Now I want to take
those boxes, tabs, etc from various standalone tools and put them
into an integrated app.
I dont see a simple way to move stuff between MainMenus and a
cryptic comment in the IB guide says its a good idea to have
multiple NIBs. Digging around a bit I found Xcode Assistant has a
New File option for Interface Builder->Cocoa>NIB>View XIB. I
create one, copy over what was in MainMenu's Window (a Box holding
a number of NSButtons and NSTextFields), and copy over the
controller. All looks good. But now what?
How do I get that View/Controller to show up in the application
window?
Do I have to programatically load the XIB and position the view
within the app?
Do I have to turn it into an IB library object, then drag from
library to window?
_______________________________________________
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
Jerry Isdale
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