Re: Yosemite-like Toolbar: Segmented Controls, Buttons, Template Images?
Re: Yosemite-like Toolbar: Segmented Controls, Buttons, Template Images?
- Subject: Re: Yosemite-like Toolbar: Segmented Controls, Buttons, Template Images?
- From: Ken Thomases <email@hidden>
- Date: Thu, 18 Dec 2014 10:14:11 -0600
On Dec 18, 2014, at 12:57 AM, Jerry Krinock <email@hidden> wrote:
> On 2014 Dec 17, at 22:32, Ken Thomases <email@hidden> wrote:
>
>> If you use a proper template image in a button whose showsStateBy includes NSChangeBackgroundCellMask, it will show a blue effect when the button's state is NSOnState. (You don't normally explicitly set the showsStateBy of a button's cell, although you certainly can.
>
> Ken, showStateBy, presuming it means “how to show the state”, sure seems like it would be the trick I am missing. How do you do that?? If you know, you are smarter than both Xcode’s documentation viewer and even Google, who just told me:
>
> Your search - showStateBy site:developer.apple.com - did not match any documents.
You dropped an "s". shows State By -> showsStateBy.
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSButtonCell_Class/#//apple_ref/occ/instm/NSButtonCell/showsStateBy
But, as I said, it's better to just set the button type to one which has the relevant showsStateBy behavior, like NSToggleButton.
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSButton_Class/index.html#//apple_ref/occ/instm/NSButton/setButtonType:
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSButtonCell_Class/index.html#//apple_ref/doc/c_ref/NSToggleButton
Regards,
Ken
_______________________________________________
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