• 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
Re: NSButton Subclass - 2 states plus tracking image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButton Subclass - 2 states plus tracking image


  • Subject: Re: NSButton Subclass - 2 states plus tracking image
  • From: Mike Abdullah <email@hidden>
  • Date: Sun, 24 Feb 2008 19:06:23 +0000

Subclass NSButton and override the -initWithCoder: method. After calling super's implementation, replace the cell with one of your custom class.

Mike.

On 23 Feb 2008, at 23:02, Trygve Inda wrote:

Hi Trygve,

I don't you should override -value or anything like that. NSOnState
and NSOffState should do fine.

You should draw your pressed art if and only if -isHighlighted is true.

It's probably appropriate to subclass NSButtonCell for this and draw
what you like. In IB3, you can select the cell from a button and
choose a custom subclass.

Concerning what to override, -drawWithFrame:inView: is the top level
drawing method for cells, the analog of -drawRect:. -
drawBezelWithFrame:inView: is called from -drawWithFrame:inView:, and
is used to draw the part of a button that interior text and images sit
on. This the glassy looking part of a standard aqua push button, for
example. Finally, -drawInteriorWithFrame:inView: is also called from -
drawWithFrame:inView:, and this method draws the text and/or images
that sit on top of the bezel.


-Ken

How is best to do this in Tiger with IB2?

T


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >Re: NSButton Subclass - 2 states plus tracking image (From: Trygve Inda <email@hidden>)

  • Prev by Date: tricky window status
  • Next by Date: Clearing an NSTextView
  • Previous by thread: Re: NSButton Subclass - 2 states plus tracking image
  • Next by thread: POSIX thread in cocoa project
  • Index(es):
    • Date
    • Thread