• 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 darkens background when pressed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButton darkens background when pressed


  • Subject: Re: NSButton darkens background when pressed
  • From: Glen Simmons <email@hidden>
  • Date: Wed, 3 Mar 2004 08:53:41 -0600

On Mar 3, 2004, at 8:23 AM, Jeremy Dronfield wrote:


On 2 Mar 2004, at 4:06 pm, Glen Simmons wrote:

I'm using NSButtons with no border and with the "Momentary Change" behavior set in IB and my own graphics for the "up" and "down" states. The problem is that NSButton takes it upon itself to darken its rect when it's pressed and I don't want that. I've fiddled with the button's NSButtonCell using -setHighlightsBy: and -setShowsStateBy: to no avail.

Any idea how to restrain this behavior?

This shouldn't happen. I find that the following settings work:

[[myButton cell] setHighlightsBy:NSContentsCellMask];
[[myButton cell] setImage:myImage];
[[myButton cell] setAlternateImage:myAltImage];

Set the button to be borderless and non-transparent, and it should work without showing the darkening effect.
-Jeremy

Thanks for the reply. After further experimentation, it turns out the alternate image is darker, which causes the effect. D'oh! Time to yell at the graphics dude.

Thanks,
Glen
_______________________________________________
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.


References: 
 >NSButton darkens background when pressed (From: Glen Simmons <email@hidden>)
 >Re: NSButton darkens background when pressed (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: uninitialize
  • Next by Date: NSTextStorage: Deadlock
  • Previous by thread: Re: NSButton darkens background when pressed
  • Next by thread: CFDictionary
  • Index(es):
    • Date
    • Thread