[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple filters

Rochelle Hatton wrote:
> Actually, I am using IDL on a Sun. We have a few different
> versions of IDL due to the versions of Unix we have installed
> around the place.
> I was working in 5.1(I know, I know) to ensure compatibility on
> all our systems when I first posted my query.
> Strangely, I was reading the online help about dialog_pickfile in 5.4
> and came across this:
>     "On UNIX, the FILTER keyword does not support specifying more
>     than one filter.
>     If you specify more than one filter, all files in the current
>      directory will be displayed.
>     For example, to display only files of type .jpg, .tif, or
>     .png   in the file selection window, you could use the
>     following code:
>     file = DIALOG_PICKFILE(/READ, $
>        FILTER = ['*.jpg', '*.tif', '*.png'])..."
> Rochelle Hatton
> Department of Nuclear Medicine and Ultrasound
> Westmead Hospital
> ph(02) 9845 7223

It's a little while since you asked this question, but maybe you are
still interested in how to do this? What is meant with "a single
filter" is a little ambiguous: do you want all these files displayed
simultaneously (as in your example, where you want all "image" files),
or do you want to select different file types exclusively (these are
ususally listed in a drop down box). [... and of course you can also
conceive a situation where you want both, e.g. "Text documents (*.sdw,
*.doc, *.txt)", "Graphics (*.tif, *.jpg)", etc.]

Now, the Unix filter only allows one "exclusive" selection, but
(contrary to the Windows version) can be edited by the user. I have
never tried to use the simulataneous entries which according to the
documentation should work as you suggest, but you can achieve such an
effect with something like "*.[jtp][pin][gfg]" (often it is
sufficiently exact to specify something like "*.[jtp]??" instead). In
summary: take advantage of the way Unix expands wild cards. 


[[ Dr. Martin Schultz   Max-Planck-Institut fuer Meteorologie    [[
[[                      Bundesstr. 55, 20146 Hamburg             [[
[[                      phone: +49 40 41173-308                  [[
[[                      fax:   +49 40 41173-298                  [[
[[ martin.schultz@dkrz.de                                        [[