• 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: Sun, 20 Nov 2005 16:34:25 -0600

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

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

No wait, the behavior of "Quit" is how I want it to be; Open is not doing what I want. Oh, and Quit is connected directly to NSApplication in the stationery, so in order to get the behavior I want I needed to reconnect it to the First Responder.


On Nov 19, 2005, at 4:15 AM, Derrick Bass wrote:

First, when the dialog is displayed, the Quit menu item is disabled. How do I enable it?
Second, although the "Open Recent" menu is disabled, the "Open..." item still works! How do I disable it?

Okay, I figured it out, although I still don't really understand the "why" of it, so if someone can explain it...


My application is based on the QTKitAdvancedDocument sample code. In that code, the openDocument: action is overridden in the application's delegate, and apparently that is enough to make the "Open..." item active even during a modal dialog.

Okay, so that brings up a new question. The reason QTKitAdvancedDocument does this is because it wants a custom panel:shouldShowFilename filter (to display all types that QuickTime can open) and the way it does this is by implementing openDocument: and attaching self as the delegate of the save panel. So, how can I get a custom filter without doing that? Do I need to subclass NSDocumentController?

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
I'd still like to know the answer to this one. Clearly the App's delegate is in the responder chain in both cases. Presumably the document controller is not in the chain when the app is running a modal dialog. Also, since when Quit is directly connected to NSApplication it is inactive during a modal dialog, either NSApplication is not in the responder chain during a modal dialog or else directly connected actions are handled differently or else there's special handling for [NSApplication terminate:]. Or something else? Anyway, I'd really like to understand this.

Derrick

_______________________________________________
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


References: 
 >Re: Modal dialog weirdness (From: Derrick Bass <email@hidden>)

  • Prev by Date: Thread context switch
  • Next by Date: Re: Modal dialog weirdness
  • Previous by thread: Re: Modal dialog weirdness
  • Next by thread: Re: Modal dialog weirdness
  • Index(es):
    • Date
    • Thread