Re: Wring code without interface builder
Re: Wring code without interface builder
- Subject: Re: Wring code without interface builder
- From: Marco Binder <email@hidden>
- Date: Sun, 04 Aug 2002 20:52:41 +0200
Albert Russel wrote:
>
Are there examples available that show how this is done. I simply do not
>
understand how you can define position and behaviour of controls and views
>
without the Interface Builder. Must I edit .nib files, can that be done from
>
Project Builder? And by the way, I hope that the Developer documentation for
>
OS X 10.2 will be a lot better than what we have now.
Well, to answer you latter question first: no, Jaguar dev docs will be
essentially the same as we have now.
If you wanna programatically create your app4s interface, you just have to
instantiate the appropriate classes. You really should have a look at the
documentation of NSWindow, NSView and NSApplication.
You define positions and stuff by setting the frame of your views or
controls. The frame-rect always refers to ist superview4s coordinate system.
So, if created a window with rect (ths time screen base coordinates)
100,100, 200, 300 (x,y, width, height) and you wanna place a button in the
middle of it, you4d go ahead and create a NSButton, add your button to your
windows contents view as a subview (refer to NSView documentation- it4s
[NSView addSubview]) and specify the buttons frame to be NSRect(90,140, 20,
20) for a 20x20 pixels button in the middle of your window.
It4s really sraightforward and should not be a problem, just consult the
documentation even if you dont like it. But: why dont you just USE
InterfaceBuilder?
marco
_______________________________________________
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.