Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.