• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Drawing a Subclass of NSButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: Leave NSLog()s in Final Product?
  • Next by Date: Re: Internal Framework linked from an internal helper app
  • Previous by thread: Re: Leave NSLog()s in Final Product?
  • Next by thread: [ANN] PlistEdit Pro 1.0.1
  • Index(es):
    • Date
    • Thread