Re: Creating NSButton in Code does not set controlTint to currentControlTint
Re: Creating NSButton in Code does not set controlTint to currentControlTint
- Subject: Re: Creating NSButton in Code does not set controlTint to currentControlTint
- From: Uli Kusterer <email@hidden>
- Date: Sat, 28 Dec 2013 15:05:42 +0100
On 28 Dec 2013, at 14:39, Uli Kusterer <email@hidden> wrote:
>> To repeat… I expected the above code to produce a button which when pressed displays the Blue Aqua tint. It doesn't! Why not?
>> Why does it show the Aqua tint if I set up the exact same button using IB and let it be instantiated from the nib?
>> Because that's where I got the information for the above set… statements. In my naiveté I assumed I would get the same behaviour.
>
> What are you trying to achieve with all this? What do you mean by “display the blue aqua tint”? I think you’re misunderstanding the terminology. The tint is a color that is used for accents on *some* controls to make important parts stand out more, and to show whether a button is clickable even when its window is inactive. On pushbuttons, the tint was ever only used for the default button (the one that reacts to the return key) and for click-highlighting a button. The OS does that correctly and automatically, there is no reason for you to change this. The tint is *not* a way to theme a button or give it a particular color.
Are you perhaps trying to implement “sticky” buttons? I.e. buttons that toggle between on and off when clicked? These haven’t highlighted in blue for a long time, but may have in 10.1 or earlier, I’m not sure anymore. Anyway, if you want that, that depends on the button type. I see you’re setting that to NSToggleButton. A toggle button only changes the image/alt image when clicked. Maybe you want NSPushOnPushOff button, which according to the docs highlights the button when pressed, too? This highlight is usually grey, not in the control tint, but maybe that’s what you’re looking for?
Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere...”
http://zathras.de
_______________________________________________
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