comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » multiple filters take 2
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
multiple filters take 2 [message #23285] Wed, 17 January 2001 21:13 Go to next message
nrh is currently offline  nrh
Messages: 19
Registered: September 2000
Junior Member
A few days ago I asked about the possibility of using multiple file
filters with a file selection program. After much fiddling with an
old program, I decided to have a go at writing a new version that uses
DIALOG_PICKFILE.
My question still remains - the help on DIALOG_PICKFILE seems make no
sense - is it a Windows only option?
I can't work out from the help whether it is possible on Unix, or is
it a feature request for RSI?
Alternatively, has anyone written their own version to allow for more
than one filter?

--
Basic research is what I am doing when I don't know what I am doing.
Werner Von Braun (1912-1977) German rocket engineer

Rochelle Hatton
Department of Nuclear Medicine and Ultrasound
Westmead Hospital
Re: multiple filters [message #23324 is a reply to message #23285] Tue, 16 January 2001 14:49 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Rochelle Hatton (nrh@imag.wsahs.nsw.gov.au) writes:

> The help documentation is still an enigma though..,

Well, it weeds out the rift-raft. :-)

Cheers,

David

P.S. I just re-read the documentation for Dialog_Pickfile.
Let's just say it hasn't marginally *improved* since IDL
5.1. :-)

--
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
Re: multiple filters [message #23325 is a reply to message #23285] Tue, 16 January 2001 14:09 Go to previous messageGo to next message
nrh is currently offline  nrh
Messages: 19
Registered: September 2000
Junior Member
Well I feel totally stupid now - just as well most of you are asleep.

I discovered that I wasn't using dialog_pickfile at all, but a custom

version we wrote years ago, that uses SPAWN. Allow me to dig a hole

and bury myself :)

...The help documentation is still an enigma though..,

--
Basic research is what I am doing when I don't know what I am doing.
Werner Von Braun (1912-1977) German rocket engineer

Rochelle Hatton
Department of Nuclear Medicine and Ultrasound
Westmead Hospital
Re: multiple filters [message #23327 is a reply to message #23285] Tue, 16 January 2001 13:58 Go to previous messageGo to next message
nrh is currently offline  nrh
Messages: 19
Registered: September 2000
Junior Member
David Fanning wrote:

> I presume you are using a PC version of IDL, since a
> single file filter has been the only option there for
> some time. DIALOG_PICKFILE has been made marginally
> smarter in IDL 5.4, in that you can now specify a
> string array of file filters and it will recognize
> all of them.
>

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'])..."

Sounds like some obscure alien talk to me - doesn't this sound
a little contradictory? First it says it won't work, and then it gives
an example of how it *would* work.Or perhaps the example is actually about
the paragraph much earlier - for Windows?
I tried it anyway, and what actually happens at the start
is that the files displayed use the first filter in the array.
After that(when you change directories), nothing gets displayed
- completely the opposite to what the help file says!
Curiouser and curiouser....
All that grumbling late last year on the newsgroup about reading
documentation...I guess it helps if the documentation is clear:)

--
Basic research is what I am doing when I don't know what I am doing.
Werner Von Braun (1912-1977) German rocket engineer

Rochelle Hatton
Department of Nuclear Medicine and Ultrasound
Westmead Hospital
ph(02) 9845 7223
Re: multiple filters [message #23339 is a reply to message #23285] Tue, 16 January 2001 06:43 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Rochelle Hatton (nrh@imag.wsahs.nsw.gov.au) writes:

> I've trawled the archives, with little luck, but hopefully it's
> an easy question - is there a workaround to use more than one
> filter in DIALOG_PICKFILE ?
> Or has someone got a nice tidy little programto do this?
> All the ones I have are a bit too involved for what I need.

I presume you are using a PC version of IDL, since a
single file filter has been the only option there for
some time. DIALOG_PICKFILE has been made marginally
smarter in IDL 5.4, in that you can now specify a
string array of file filters and it will recognize
all of them.

Unfortunately, the filters are listed on a single
filter line in the little droplist widget that
shows the filters, so it is an all or nothing
kind of thing. Every other Windows application I've
ever used separates each individual filter, which
I presume is what we were looking for when we
asked for this feature. :-(

Perhaps we should file another feature request.

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
Re: multiple filters [message #23657 is a reply to message #23327] Tue, 06 February 2001 04:02 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
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).

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 "*." (often it is
sufficiently exact to specify something like "*.[jtp]??" instead). In
summary: take advantage of the way Unix expands wild cards.

Cheers,
Martin



--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ 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 [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: speed comparison of IDL, numPy, Matlab
Next Topic: Correction

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 08:33:41 PDT 2025

Total time taken to generate the page: 0.48004 seconds