Re: Best way to get different events for a button mouseDown and mouseUp?
Re: Best way to get different events for a button mouseDown and mouseUp?
- Subject: Re: Best way to get different events for a button mouseDown and mouseUp?
- From: Mike Ferris <email@hidden>
- Date: Sun, 29 Dec 2002 10:45:24 -0800
Buttons are not really set up for this, so what you describe may be the
easiest thing.
If what you intend is to have something going on while the button is
down and then stop when it is up, though, you might want to look at the
-setContinuous: and -setPeriodicDelay:interval: API...
Mike
Begin forwarded message:
From: Dan Wood <email@hidden>
Date: Sat Dec 28, 2002 2:30:26 PM US/Pacific
To: Cocoa dev <email@hidden>
Subject: Best way to get different events for a button mouseDown and
mouseUp?
I have a need for some buttons that need to notify my code on both the
"mouse down" AND the "mouse up". It looks like one way to do this is
to make a subclass of NSButtonCell and override
startTrackingAt:inView: and stopTracking:at:inView:mouseIsUp:, and
also subclass NSButton and call setCellClass: to associate my button
cell class with the button. Then I'd store selectors that the button
cell would invoke, and hook up a pseudo "action" for mouse up and
mouse down.
Is this the preferred way to do this? It seems like there ought to be
something simpler, but I don't see it.....
--
Dan Wood
Karelia Software, LLC
email@hidden
http://www.karelia.com/
Watson for Mac OS X: http://www.karelia.com/watson/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.