Re: Pressable Button

2008-12-17 Thread Gerriet M. Denkmann
Following Peters advice: Consider using a single-segment NSSegmentedControl. It has this behavior built-in. I am not completely satisfied: I want the NSOnState shown as done in an NSButton with buttonType = NSOnOffButton and bezelStyle = NSTexturedSquareBezelStyle. In the header file I

Re: Pressable Button

2008-12-16 Thread Gerriet M. Denkmann
On 17 Dec 2008, at 00:56, Stéphane Sudre wrote: On Dec 16, 2008, at 4:02 PM, Gerriet M. Denkmann wrote: I am trying to build a pressable button: an on-off button (subclass of NSButton), which, if pressed for more than 0.3 seconds, displays a context menu. My idea was: Start a non

Re: Pressable Button

2008-12-16 Thread Peter Ammon
On Dec 16, 2008, at 7:02 AM, Gerriet M. Denkmann wrote: I am trying to build a pressable button: an on-off button (subclass of NSButton), which, if pressed for more than 0.3 seconds, displays a context menu. Consider using a single-segment NSSegmentedControl. It has this behavior built

Re: Pressable Button

2008-12-16 Thread Stéphane Sudre
On Dec 16, 2008, at 4:02 PM, Gerriet M. Denkmann wrote: I am trying to build a pressable button: an on-off button (subclass of NSButton), which, if pressed for more than 0.3 seconds, displays a context menu. My idea was: Start a non-repeating timer in mouseDown: and schedule it with

Pressable Button

2008-12-16 Thread Gerriet M. Denkmann
I am trying to build a pressable button: an on-off button (subclass of NSButton), which, if pressed for more than 0.3 seconds, displays a context menu. My idea was: Start a non-repeating timer in mouseDown: and schedule it with NSEventTrackingRunLoopMode. In mouseUp: invalidate the timer