Re: GUI without IB
Re: GUI without IB
- Subject: Re: GUI without IB
- From: Lance Drake <email@hidden>
- Date: Mon, 7 Jun 2004 11:38:01 -0600
Hi Max,
Having just come off of such an exercise, here is the condensed
benefit of my learning -experience. Perhaps you're aware of all this,
but, like they say, 'take the best and leave the rest'.
A) Get hip to 'IsFlipped' - the lower-left coords of NSView are
different from the old way - and the PC-way of referencing where things
are located. Also, there are MANY useful macros in NSGeometry.h
that'll help you set and jiggle rects as you would wish.
B) NXTextFields are subclassed from 'NSControl' - which is subclassed
from 'NSCell'. In order to make changes to your object in a view,
you'll likely be referring to things as in: '[[[textfield cell]
controlView] setFrame:myRect]' - which may seem like a long way to go
to change location, etc - but that's the way it is.
C) Read the docs on 'Retain' and 'Release' of NSObjects as you'll need
to know what happens when you 'removeAllObjects' from NSMutableArray or
'removeFromSuperview' from NSView - and stuff like that.
When in doubt, check it out: int count = [myobj retainCount] is useful
on figuring out things got to the point your object is no longer
'there'. Boning up on NSAutoreleasePool is another opportunity for
learning how not to leak memory.
D) Programatically setting 'target' and 'action' for controls is a
cinch - as is setting font definitions, z-axis of objects over each
other, alignment of objects in a group to each other... it goes on and
on. I am not sure if I need ever again need rely on IB - which does
save ALOT of heavy-lifting, but has design-limits, as well. Perhaps
the nicest thing about a roll-your-GUI is the way you can generate and
manipulate an arbitrary number of things, in realtime, as needed.
E) The Scott Anguish (et al) and Aaron Hillegasse books have wonderful
Cocoa examples and tutorials. For instance, the whole question of 'How
the heck do you create and use an NSTableView?' is really well
presented in 'Cocoa Programming' by Anguish/Buck/Yachtman. Aaron
Hillegass ('Cocoa Programming For Mac OS X' - Second Edition) covers
all sorts of cool sidebars such as 'Nib Files and NSWindowController'.
That's all the news that fits...
Be cool!
Lance Drake
_______________________________________________
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.