> 1. I have an NSButton that toggles an operation between active and suspended. > 2. At some point the operation completes and I process the results of the > operation. > 3. The user can still toggle the operation for the few seconds that the > result is being processed. >
Don't discard, prevent. Disable the button when you don't want clicks on it to register. Enable it when you do. Discarding valid clicks is bad UI. Having a button enabled that doesn't work is bad UI. > I wish to discard the NSButton action triggering events that occur while the > results are processed to stop a further operation from being initiated. > Once the operation is done and processed I don't want to respond to any > previous mouse click events that remain in the event queue for that button. > Filtering on the timestamp seemed like the way to go. > > It seems curious that there is no message such as [NSEvent currentTimestamp] > as the timestamp is required by most of the NSEvent factor methods. > Probably explains why the app kit generated event has a zero timestamp. > > sysctl doesn't seem to offer the system up time, just kernel boot time > (corrections welcome). > > I did some brief examination of using a mach clock timer but I might be on > completely the wrong track. > > There might be other ways of achieving my desired behaviour but the event > filter is appealing. > > Thanks > > jonathan _______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com