The docs indicate that the button “type” is not actually a property itself. The 
setter simply sets some group of properties to reflect the behavior represented 
by the button type constant. NSButtonCell showsStateBy property value might be 
the closest thing. You might also put a breakpoint on setState: to see if it is 
being set when it shouldn’t, and maybe by whom.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

> On Aug 20, 2018, at 4:04 AM, Guillaume Laurent <glaur...@telegraph-road.org> 
> wrote:
> 
> Hi all,
> 
> 
> For a custom UI I’ve had to write a custom control deriving from NSButton, 
> which highlights itself in a special way on mouse-over. In the method which 
> does the highlighting, I check if the button’s state is either .on or .off, 
> so I know which title or alternateTitle to display. But I realized that, no 
> matter the button's type, the state is always toggled on click. That is, even 
> if the button’s type is set to MomentaryPushIn, the button’s state is toggled 
> after a click. I’d have thought that this was the case only for 
> OnOff/Toggle/Switch… types.
> 
> Since there is no NSButton.type getter, is there a way to determine if the 
> button’s type is toggleable or not ? And what is the reason for switching 
> state for types like MomentaryPushIn ?
> 
> 
> Thanks,
> 
> Guillaume.
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to