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: Peter Teeson <email@hidden>
- Date: Thu, 26 Dec 2013 18:08:34 -0500
Thanks for your kind reply.
On 2013-12-26, at 4:51 PM, Keary Suska <email@hidden> wrote:
> On Dec 26, 2013, at 10:49 AM, Peter Teeson wrote:
> If you need something other than the default, I imagine you are expected to set it yourself.
I've checked what the cell's controlTint is immediately after being instantiated. It is indeed the default (i.e. zero).
This is going to be the same as the System tint (cf SystemPrefs Appearance which is set to Blue a.k.a Aqua) the way the system comes.
So when I created the NSButton in code I anticipated that clicking on it would display an Aqua colour but in fact it displays a Graphite colour.
If I created one in IB it does display the Aqua colour. Interestingly if examine both the Type and the associated Image they are Text and nil respectively.
This is true for both the one instantiated from the nib and from the one created with code. No idea why that should be.
Even if I change the type to ImageCell there is still a nil image.
So I do not understand how the system is doing it's Blue alternate colouring.
Simply put. all I wish to do is instantiate an NSButton in code and have it present the Aqua colour when pressed and not the Graphite.
Shucks how hard can that be and what is wrong with my code that that does not happen.
Do I really have to subclass NSCell and provide designated initializers for such a simple thing? That sort of smells to me.
> You could always make a generic NSButton subclass that you can use in Interface Builder to see how various attributes are set.
I will give that a try and thanks for the idea.
respect…
Peter
_______________________________________________
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