[Solved] Custom file filter interferes with modal window (Was: Modal dialog weirdness)
[Solved] Custom file filter interferes with modal window (Was: Modal dialog weirdness)
- Subject: [Solved] Custom file filter interferes with modal window (Was: Modal dialog weirdness)
- From: Derrick Bass <email@hidden>
- Date: Mon, 21 Nov 2005 19:57:52 -0800
- Resent-date: Mon, 21 Nov 2005 21:35:47 -0800
- Resent-from: Derrick Bass <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: email@hidden
On Nov 20, 2005, at 2:34 PM, Derrick Bass wrote:
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?
Well, that's what I did. Turned out to be very easy. I created a
subclass of NSDocumentController and moved the following three
methods from the application's delegate into it:
- (id)openDocumentWithContentsOfFile: display:
- (BOOL)panel: shouldShowFilename:
- (void)openDocument:
Now my app can open all the types that QuickTime can open, but
doesn't respond to "Open…" when there's a modal window in front. Yay!
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