bug with acceptsFirstMouse: behavior
bug with acceptsFirstMouse: behavior
- Subject: bug with acceptsFirstMouse: behavior
- From: Matt Neuburg <email@hidden>
- Date: Tue, 29 Nov 2005 10:51:43 -0800
- Thread-topic: bug with acceptsFirstMouse: behavior
Make two windows, and in one of them put a switch (a checkbox).
Let's say you don't want the user, clicking within this window to bring it
to the front, to accidentally change the checkbox setting too. So make the
checkbox an NSButton subclass where you return NO from acceptsFirstMouse:.
So far so good. Now here's the problem. Run the app, put the window with the
checkbox in back, and click twice pretty quickly on the checkbox.
The first click brings the window to the front without toggling the
checkbox, as desired. But the second click toggles the checkbox TWICE,
leaving it back where it was. The user will feel this as buggy: you can
actually see the checkbox swiftly change state twice in succession.
I can imagine (and have tried) various workarounds involving dequeuing
events, clickCounts, timers, etc., but it seems to me that this behavior is
a bug. Having discarded the first click as a possible checkbox toggle, Cocoa
should truly discard it, not save it up and surprise the user with it later.
Comments are welcome. If there's agreement that it's a bug I'll submit it.
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden