Re: is there a way to determine if an NSButton is toggleable ?

2018-08-22 Thread Uli Kusterer
> On 20. Aug 2018, at 12:04, Guillaume Laurent > 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

Re: is there a way to determine if an NSButton is toggleable ?

2018-08-21 Thread Guillaume Laurent
> On 21 Aug 2018, at 01:39, Jeff Nadeau wrote: > > NSButton is interesting in that it separates out the state (e.g. > `isHighlighted` and `state`) from the presentation of that state. The state > manipulation behavior is totally uniform, i.e. the `state` property always > toggles between

Re: is there a way to determine if an NSButton is toggleable ?

2018-08-20 Thread Jeff Nadeau
NSButton is interesting in that it separates out the state (e.g. `isHighlighted` and `state`) from the presentation of that state. The state manipulation behavior is totally uniform, i.e. the `state` property always toggles between Off and On when any button is clicked. Most buttons aren't

Re: is there a way to determine if an NSButton is toggleable ?

2018-08-20 Thread Keary Suska
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

is there a way to determine if an NSButton is toggleable ?

2018-08-20 Thread Guillaume Laurent
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