On Feb 1, 2010, at 6:18 PM, Nathan Kinsinger wrote: > On Feb 1, 2010, at 2:42 PM, Eric Gorr wrote: > >> What I am trying to accomplish is displaying a menu (perhaps with >> NSPopUpButtonCell's performClickWithFrame method) after a user clicks on a >> sublass of NSButton and holds the left mouse button for >= 1 second. >> >> Is anyone aware of any sample code doing this? > > Look at KBPopUpToolbarItem.m > http://www.literatureandlatte.com/freestuff/index.html
While looking over this code, it prompted me to take a closer look at NSCell. I noticed in NSCell, that the documentation for trackMouse:inRect:ofView:untilMouseUp: says: This method is generally not overridden because the default implementation invokes other NSCell methods that can be overridden to handle specific events in a dragging session. Some of those other methods it is referring to are: startTrackingAt:inView: continueTracking:at:inView: stopTracking:at:inView:mouseIsUp: However, it does not appear the implementation of trackMouse:inRect:ofView:untilMouseUp: for a NSButtonCell calls continueTracking:at:inView: or stopTracking:at:inView:mouseIsUp: which I believe would have been useful in my situation. I would have liked to not need to have a complete rewrite of trackMouse:inRect:ofView:untilMouseUp:. If it matters, I am building with the 10.5 SDK. I have filed a bug requesting that trackMouse:inRect:ofView:untilMouseUp: call continueTracking:at:inView: and stopTracking:at:inView:mouseIsUp: ... or is there a reason why it shouldn't? rdar://7602114 _______________________________________________ Cocoa-dev mailing list ([email protected]) 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 [email protected]
