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

NSButton Subclass - 2 states plus tracking image


  • Subject: NSButton Subclass - 2 states plus tracking image
  • From: Trygve Inda <email@hidden>
  • Date: Sat, 23 Feb 2008 12:19:26 +0000
  • Thread-topic: NSButton Subclass - 2 states plus tracking image

I need an NSButton with 5 different graphics and two states:

State 0  (enabled & disabled graphics)
State 1  (enabled & disabled graphics)
Pressed/Tracking state

I was thinking to subclass NSButton and in IB use "Momentary Change" so that
I can set the alt image to always be my Pressed/Tracking state and the
subclass will change the main image to one of the other 4 images as needed.

The problem I see is that Momentary Change buttons are really single state
so I think my action method for the button would have to also toggle a value
variable and I may need to override value/setValue to use my custom value.

If I set up a two state button, how can I provide a custom tracking image...
Eg when drawRect is called, how can I tell that my button is being pressed
and tracked?

Is there an existing class out there that will just do this? I haven't come
across one.

Thanks,

Trygve




_______________________________________________

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

  • Follow-Ups:
    • Re: NSButton Subclass - 2 states plus tracking image
      • From: Ken Ferry <email@hidden>
  • Prev by Date: Xcode has no rule to process .xib files in one of my projects
  • Next by Date: POSIX thread in cocoa project
  • Previous by thread: Xcode has no rule to process .xib files in one of my projects
  • Next by thread: Re: NSButton Subclass - 2 states plus tracking image
  • Index(es):
    • Date
    • Thread