Skip navigation.
 
mlRe: Quitting when Menu closes
FROM : John Stiles
DATE : Sat Nov 03 23:01:57 2007

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_removed>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/jstiles%
> 40blizzard.com
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlQuitting when Menu closes Eric Celeste Nov 3, 17:51
mlRe: Quitting when Menu closes Andreas Mayer Nov 3, 19:23
mlRe: Quitting when Menu closes Eric Celeste Nov 3, 22:44
mlRe: Quitting when Menu closes John Stiles Nov 3, 23:01