Re: Quitting when Menu closes
Re: Quitting when Menu closes
- Subject: Re: Quitting when Menu closes
- From: John Stiles <email@hidden>
- Date: Sat, 3 Nov 2007 15:01:57 -0700
Do you really think it will be fast enough to launch it in response
to a mouse click, every time?
Usually an app like this will always be running silently, not
quitting and restarting itself constantly.
On Nov 3, 2007, at 2:44 PM, Eric Celeste wrote:
Any ideas what I'm doing wrong?
Nothing.
OK. At least that makes me feel a bit better!
Any other thoughts on how to quit the
app upon the menu close?
If something is hard to do in Cocoa, it's usually because it's - at
least - uncommon.
Why would you want to close your application if the user *aborts* an
action? That's not at all intuitive.
While it's most likely still possible (involving subclassing,
probably), I think shouldn't waste more time on that.
I'm writing an app similar to DejaMenu, but designed to be launched
(by a Mighty Mouse click), do its work (present a copy of the menu bar
at the current mouse location), and disappear. So far all works well
except the disappear. If the user aborts the menu in this case, they
are aborting the whole app. It should just disappear.
This is certainly an uncommon case. I've tried the notification
approach as well, but it seems that NSMenuDidEndTrackingNotification
is sent before NSMenuDidSendActionNotification (I'm writing a test app
to confirm that right now), so that just resulted in the whole app
terminating before legitimate actions were taken.
I am puzzled that my window, which is set up as a delegate for the
menu, does not seem to be getting the menuWillClose: call.
Of course, if there is another way to sense an aborted menu close (as
opposed to a proactive click on a menu item) that would be ideal.
...Eric
--
Eric Celeste / http://eric.clst.org / Saint Paul, MN / 651-323-2009 /
email@hidden
_______________________________________________
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:
40blizzard.com
This email sent to email@hidden
_______________________________________________
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