Re: widget function returns an array [message #19683] |
Thu, 13 April 2000 00:00 |
John-David T. Smith
Messages: 384 Registered: January 2000
|
Senior Member |
|
|
eeeyler@my-deja.com wrote:
>
> I wish to make a widget that will allow me to select multiple
> sub-directories from a parent directory and return a string array of
> those sub-directories when I click a 'done' button. I wish to return
> the array to a parent procedure, and have the widget destroyed. Can
> this be done?
>
Oh yes. Look into widget_list,/MULTIPLE along with
widget_info(wid,/LIST_SELECT). Finding subdirectories in a platform independent
way is somewhat troublesome in IDL, and usually requires various
platform-specific flags to findfile() being employed. If you don't care about
platform independence, your job will be easier.
JD
--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
|
|
|
Re: widget function returns an array [message #19684 is a reply to message #19683] |
Thu, 13 April 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Eric (eeeyler@my-deja.com) writes:
> I wish to make a widget that will allow me to select multiple
> sub-directories from a parent directory and return a string array of
> those sub-directories when I click a 'done' button. I wish to return
> the array to a parent procedure, and have the widget destroyed. Can
> this be done?
This can't be done with anything built into IDL, since
Dialog_Pickfile does not support multiple directory
selection. (It does support multiple file selection,
so I suppose it *might* work in UNIX, but I can't test
it here.) Such a compound widget would be fairly easy
to build, I should think.
Getting the information back to the calling program is
also easy. See the "Writing Modal Widget Dialogs" chapter
of my book. :-) (Or, if you are one of the three or four
people still without a book, see a program like GetImage
on my web page for an example of how it is done.)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|