• 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 dialog weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modal dialog weirdness


  • Subject: Re: Modal dialog weirdness
  • From: Derrick Bass <email@hidden>
  • Date: Sat, 19 Nov 2005 14:41:09 -0600
  • Resent-date: Sat, 19 Nov 2005 20:49:39 -0600
  • Resent-from: Derrick Bass <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: email@hidden


On Nov 19, 2005, at 1:54 PM, Sherm Pendley wrote:


On Nov 19, 2005, at 2:24 PM, Derrick Bass wrote:



On Nov 19, 2005, at 5:37 AM, j o a r wrote:



First, when the dialog is displayed, the Quit menu item is disabled. How do I enable it?



This is the intended behaviour. If you want to change it, you'll probably need to change the action method for that menu item.




It's currently connected to terminate:, of course. I tried adding a terminate: method to the dialog's controller class (which just called through to [NSApp terminate:]) in the hopes that it would be picked up by the responder chain, but it didn't help.



Is the menu item connected to the responder chain in IB, or to the Nib's owner?



Ooops. Quit was connected to the Nib's owner (NSApplication). I reconnected it to the First Responder, so now Quit works during the modal dialog. (By the way, I was able to remove the forwarding function.) Open was and still is connected to the First Responder.

So now at least both actions are consistent. But they are consistently not what I want ;-)

Can someone point me to an explanation on how menu item enabling works in Cocoa? And how it changes during a modal dialog? I was under the impression that it checked to see whether some object on the responder chain could respond to the action and if so, it would check if that object had a validateMenuItem and call it. Now clearly that can't be the case when the menu item is connected to an object instead of the responder chain. But in that case, I'd expect everything to be much simpler; the message just gets sent. That's it. So, why would connecting "Quit" directly to the NSApplication instance make any difference?


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Modal dialog weirdness
      • From: Derrick Bass <email@hidden>
    • Re: Modal dialog weirdness
      • From: j o a r <email@hidden>
  • Prev by Date: Re: NSTableView & subclass of NSButtonCell - odd problem?
  • Next by Date: Re: adding Foundation framework to a Carbon application SOLVED
  • Previous by thread: Re: Modal dialog weirdness
  • Next by thread: Re: Modal dialog weirdness
  • Index(es):
    • Date
    • Thread