On Jan 12, 2009, at 10:54 AM, I. Savant wrote:

On Mon, Jan 12, 2009 at 10:48 AM, Paul Bruneau
<paul_brun...@special-lite.com> wrote:

The way I did a similar thing (and I think this is the standard way) was to
create a custom NSView subclass to draw the control.

 Well ... the *standard* way is to use the control/cell system, but
the *easier* way is sometimes to simply use a custom NSView subclass
as you said. :-)

http://developer.apple.com/documentation/Cocoa/Conceptual/ControlCell/ControlCell.html

 NSControl gives you a lot of freebies that you'd have to implement
yourself (especially support for things such as accessibility
features, etc.) but at the cost of having to get your hands dirtier
with creating a custom cell. It's a bit more involved but usually more
appropriate if it's an interactive UI widget (ie, a "control" and not
simply a "view").

You know, it's funny, when I first started my first Cocoa project as a total Cocoa newb I wanted to use controls/cells for my rectangles but I was strongly advised against it by very highly regarded Cocoa gurus.

Maybe it's because my project could have hundreds of rectangles in a single view and the gurus were concerned about all the overhead?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to