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

Re: NSOpenPanel validation?


  • Subject: Re: NSOpenPanel validation?
  • From: m <email@hidden>
  • Date: Sun, 31 Oct 2004 14:46:26 -0800

For the archives:

I managed to get the behavior I was after by subclassing NSOpenPanel and overriding the ok: method to do the validation and alert posting. Not as clean a solution as I''d have liked, but it works well.

_murat

On Oct 31, 2004, at 1:06 PM, m wrote:

I must be missing something basic here; I can't find a delegate method that allows me to validate the selection in an NSOpenPanel.

I'm running NSOpenPanel as a sheet to import some files. Folders may also be selected and the contents imported.

If the user selects "too many" files (for example, the user accidentally selects the root directory), I'd like to pop up an alert *before dismissing the open panel* informing them that importing that many files could take a long time. This would be similar to the "Replace?" alert one gets when saving a file to a name that already exists.

So the user scenario is this

1) open import sheet (an NSOpenPanel)
2) make "too many" selections
3) click "Open" button
4) a modal alert pops up to warn that "too many" files are selected
5) dismiss alert
6) adjust selection in import sheet so that not "too many" files are selected
7) click "Open" button
8) import sheet dismisses

Any help or pointers appreciated.

_murat

_______________________________________________
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: 
 >NSOpenPanel validation? (From: m <email@hidden>)

  • Prev by Date: Re: NSCell spanning columns
  • Next by Date: Re: FW: Where to include header files - relates to last question on variable scope
  • Previous by thread: NSOpenPanel validation?
  • Next by thread: alignment of combobox in a tableview
  • Index(es):
    • Date
    • Thread