Re: Showing a menu after a delay...?
Re: Showing a menu after a delay...?
- Subject: Re: Showing a menu after a delay...?
- From: Eric Gorr <email@hidden>
- Date: Tue, 2 Feb 2010 10:12:51 -0500
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@hidden)
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:
This email sent to email@hidden