Re: creating custom widgets(?)
Re: creating custom widgets(?)
- Subject: Re: creating custom widgets(?)
- From: Daniel Jalkut <email@hidden>
- Date: Tue, 10 Jan 2006 10:45:10 -0500
Hi Daniel - A general approach to creating a custom view is by
creating a custom NSView subclass that is composed of multiple NSCell
instances. There is a good write-up on this approach at Stepwise:
http://www.stepwise.com/Articles/Technical/NSCell.html. Using this
approach gives you a lot of control over how clicks are handled, in
what order NSCells draw, etc.
For this particular instance, it sounds like you want your button to
generally assume the same behavior of a standard button, but have
images and text drawn over it ? If so I'd probably recommend
subclassing NSButton and just drawing junk over the existing button
when necessary. You could still use NSCells to accomplish the drawing
if it made senes.
This UI sounds ... interesting :)
Daniel
On Jan 10, 2006, at 3:02 AM, Daniel Griffin wrote:
First time poster, short time reader. To start with I am not sure
if I am using the right terminology. I am attempting to create a
button that contains 2 images and some text for a simple instant
messenger. I am not sure how I should go about this. I am new to
cocoa and new to gui's overall. Do i subclass NSView? subclass
something else? Is there a way to add what I want to NSButton? I
have looked but I dont know if I am looking in the right place.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden