Re: NSButtonCell darkened when state is NSOnState
Re: NSButtonCell darkened when state is NSOnState
- Subject: Re: NSButtonCell darkened when state is NSOnState
- From: Ricky Sharp <email@hidden>
- Date: Mon, 15 Nov 2004 15:27:46 -0600
On Nov 15, 2004, at 3:20 PM, Stephan Burlot wrote:
I have a NSMatrix of buttons with image.
The NSMatrix is set to radio mode in IB.
Buttons are set to Square button, and behavior to "Push On/Push Off"
I want that when a button is selected, the image appears darkened.
Using trial and error, I achieved good result when the button is
clicked by setting:
[[cropButtonMatrix cellWithTag:0] setShowsStateBy:NSNoCellMask];
[[cropButtonMatrix cellWithTag:0] setHighlightsBy:NSNoCellMask];
But the state of the button is not shown when the mouse is released,
i.e. nothing is drawn in the cell to show its state.
I have tried all the constants available for setShowStateBy without
success.
What is the magical incantation to tell the NSButtonCell to display
its image darkened when it's on?
I don't think this is possible with the standard NSButtonCell.
One solution is to subclass NSButtonCell to provide your custom drawing.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden