Drawing a Subclass of NSButton
Drawing a Subclass of NSButton
- Subject: Drawing a Subclass of NSButton
- From: Michael Becker <email@hidden>
- Date: Fri, 12 Mar 2004 15:38:07 +0100
Hi everybody!
In my application, I have a button, which is drag-and-drop-enabled.
Furthermore, I want it to display a badge (like Mail.app's dock icon
does). Because I need to add the badge programmatically and dynamically
(due to its changing content), I would like to draw the button myself.
It is actually a borderless image button, so that should be fairly
simple.
However, I am not sure which method to override in order to get the
drawing right. Previously, these drop-targets were custom NSView
classes. I could handle the drawing easily in the -drawRect: method.
Now with NSButton I am not sure at all, where to put my drawing code.
What is the right approach here? Maybe take a whole other route? (Maybe
continue using custom NSView classes and implement the action-on-click
mechanism myself?)
- Michael
_______________________________________________
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.