Skip navigation.
 
mlRe: refusing first clicks for entire app
FROM : Nick Zitzmann
DATE : Thu Dec 09 02:40:00 2004

On Dec 8, 2004, at 6:28 PM, Ken Victor wrote:

> NSButton returns true for acceptsFirstMouse. i'd prefer not to have
> this behavior and only have the first click activate my app. is there
> someway, other than subclassing all my buttons, and any other controls
> that may have similar behavior, to prevent first clicks from actually
> propagating to controls? (i'd still like to maintain the ability for
> clicks on the window controls - close, minimize, expand - to still
> operate while my app is inactive.)


You could register the object for the notification that is broadcasted
when the window is no longer key (or implement the NSWindow delegate
method), and then disable whatever controls you wish to disable when
the notification selector is called. Of course, you'll also have to
re-enable them when the window becomes key again, but it'll still take
far less effort than subclassing.

Nick Zitzmann
<http://www.chronosnet.com/>

Related mailsAuthorDate
mlrefusing first clicks for entire app Ken Victor Dec 9, 02:28
mlRe: refusing first clicks for entire app Nick Zitzmann Dec 9, 02:40