• 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: NSOpenPanel isn't listening to me? I told it to only allow .zip and .xml!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOpenPanel isn't listening to me? I told it to only allow .zip and .xml!


  • Subject: Re: NSOpenPanel isn't listening to me? I told it to only allow .zip and .xml!
  • From: Andy Lee <email@hidden>
  • Date: Sun, 25 Jun 2006 11:21:11 -0400

On Jun 23, 2006, at 3:00 PM, Matt Neuburg wrote:
Saying -setAllowedFileTypes: to an NSOpenPanel while the panel is showing
causes no change in what's selectable. Evidently you're supposed to specify
the allowed file types when you start running the panel. Thus it appears
that -setAllowedFileTypes: is useless, which is weird, because in that case,
why does it exist? That, at least, is the conclusion reached during a
discussion of this issue at a different venue (a newsgroup). I myself am
just confused and would like to know how this is supposed to work.

I'm confused too. I was wondering if -setAllowedFileTypes: is obsolete and should be deprecated, but from a quick Google it looks like it was *added* in Panther.


I wonder about the case where you present a save panel in a sheet, and you have two windows with their own save panels in their own sheets, but you want the allowed file types to be different in the two windows. Presumably you do this by passing different values to - setAllowedFileTypes: just before opening each sheet. So what does [[NSSavePanel savePanel] allowedFileTypes] return? Is it the most recent value you passed to -setAllowedFileTypes:?

I wonder if this confusion is due to design holdovers from the pre- OSX days, when both save panels and open panels were very modal.

I would
think that being able to change the allowed file types while the panel is
open would be useful. m.

I just came across this method, along with the delegate method it mentions:


validateVisibleColumns

Validates and possibly reloads the browser columns visible in the receiver by invoking the delegate method panel:shouldShowFilename:.

- (void)validateVisibleColumns

Discussion

You might use this method if you want the browser to only allow selection of files with certain extensions based on the selection made in an accessory-view pop-up list. When the user changes the selection, you would invoke this method to revalidate the visible columns.

I guess this is how you can change the file types while the panel is open. It implies that it's possible for the panel not to obey the list in -allowedFileTypes.


With all this confusion, I'm glad my app is read-only. :) Or maybe it's really simple and I'm just not understanding.

--Andy

_______________________________________________
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: NSOpenPanel isn't listening to me? I told it to only allow .zip and .xml! (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Clickable NSImageCell in NSMatrix
  • Next by Date: file filter popup at *top* of save panel
  • Previous by thread: Re: NSOpenPanel isn't listening to me? I told it to only allow .zip and .xml!
  • Next by thread: top level objects and NSWindowController
  • Index(es):
    • Date
    • Thread