• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: modal window and quit menu item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: modal window and quit menu item


  • Subject: Re: modal window and quit menu item
  • From: email@hidden
  • Date: Sun, 20 Oct 2013 12:51:42 +1300


I created a simple project that uses a modal window. The quit
execution works are stated in the docs even though the window is modal.

Which means I am doing something wrong. More investigating to do.

On
19/10/2013, at 3:01 PM, Ken Thomases  wrote:

> On Oct 18, 2013, at
6:35 PM, email@hidden wrote:
>
>> Problem : quit menu stays
active
>> when a window is presented using [NSApp runModal:window].
>
>
What is the target of the Quit menu item? What is its action method? A
typical setup is that its action method is -terminate: and its target is
the main NIB's File's Owner, which is the application object.
>
> Are
you using a custom NSApplication subclass as your application object?
Does it override -validateMenuItem:? If so, show us the implementation
of that.
 No.

>> Quitting causes the menu item to be permanently
disabled.
>
>> My [NSApp applicationShouldTerminate:] delegate message
postpones the application
>> termination as certain cleanup code doesn't
work at all when invoked
>> from the message.
>
> Postpones how? In
what sense does your cleanup code not work "when invoked from the
message" (whatever that means)?
>
> It is normal that the Quit menu
item remains disabled after -applicationShouldTerminate: returns
NSTerminateLater unless and until you call
-replyToApplicationShouldTerminate: with NO.
 Forgot about this. Have
used it in other unrelated code parts.
That explains a lot (to me).


Does anyone know of

> sp;Which do you want? In any case, if you want
custom control over the Quit menu item, then you should implement
-validateMenuItem: on its target. However, you should generally avoid
doing that because the Quit menu item should behave as user's expect.
>

> I think you need to step back and explain your high-level goal. Don't
get bogged down yet in implementation. Describe your desired user
interaction design.
>
> Regards,
> Ken
>
> I more or less know what to
do now.
> Thanks for help
_______________________________________________

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


  • Prev by Date: Re: Setting key equivalent for menus depending on window
  • Next by Date: Determine keys used in NSPredicate
  • Previous by thread: Re: modal window and quit menu item
  • Next by thread: iOS Storyboard - on boarding - skip
  • Index(es):
    • Date
    • Thread