• 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: multiple selection not taking in NSOpenPanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple selection not taking in NSOpenPanel


  • Subject: Re: multiple selection not taking in NSOpenPanel
  • From: John Haney <email@hidden>
  • Date: Tue, 29 Apr 2003 10:18:48 -0700 (PDT)

Each time calling [NSOpenPanel openPanel] creates a
"fresh" panel. You need to create a variable and save
the openPanel, then modify the one instance.

NSOpenPanel *myOpenPanel = [NSOpenPanel openPanel];
[myOpenPanel setAllowsMultipleSelection: YES];
[myOpenPanel beginSheetForDirectory: ... ];

I believe it's mentioned in the docs for the class,
but it is a bit misleading as it talks a bit about
"recycling" the panel each time...

- John Haney
http://www.johnhaney.com/

--- Matthew Weinstein wrote:
> This has really been bugging me... I cannot get the
> multiple
> selection option to work in NSOpenPanel. It SEEMS so
> straight forward:
> <code>
> NSMutableArray *mytype = [NSMutableArray
> arrayWithObjects:
> @"txt", @"rtf", @"RTF", @"TXT", nil];
> [mytype removeLastObject];
> [[NSOpenPanel openPanel]
> setAllowsMultipleSelection: YES];
>
> [[NSOpenPanel openPanel]
> beginSheetForDirectory: nil file: nil
> types: mytype
> modalForWindow: myWindow modalDelegate:self
>
didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
> contextInfo: nil];
> </code>
>
> What am I missing?
> --
> Matthew Weinstein
> Associate Professor of Science Education
> Kent State University
>
> 404D White Hall
> KSU
> Kent, OH 44242
>
> 330-672-0653
>
> email@hidden
> http://educ.kent.edu/~mweinste

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Newbie Build Error
  • Next by Date: Re: [ANN] poof image Apple sample code
  • Previous by thread: Re: multiple selection not taking in NSOpenPanel
  • Next by thread: converting absolute to relative paths (and back)?
  • Index(es):
    • Date
    • Thread