Re: FSC_FILESELECT entry field [message #40057] |
Mon, 12 July 2004 08:19 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> David Fanning writes:
>
>> P.S. I'm going to have to think what to do about this.
>> I suppose it's too late to disown it.
>
> OK, I've decided to swallow my pride and fix it rather
> than re-write it. Just promise me you won't use this
> as an example, Wayne, for your own programs. :-(
>
> You can find a version here that probably works the
> way you expect it do:
>
> http://www.dfanning.com/programs/fsc_fileselect.pro
>
> Cheers,
>
> David
Oh, oh. If anyone cares about this besides Wayne, you
should know that I made the fix on Friday to an old
version of FSC_FileSelect. I have procedures in place
that are suppose to prevent this, but...what can I say...
computers!
Anyway, Wayne kindly pointed out the problem to me this
morning and I have just now put the proper file on my
web page. If anyone has downloaded this file the past
couple of days, they should probably do it again. Sorry. :-(
http://www.dfanning.com/programs/fsc_fileselect.pro
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|
Re: FSC_FILESELECT entry field [message #40070 is a reply to message #40069] |
Fri, 09 July 2004 14:20  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Wayne Landsman writes:
> I am using David Fanning's FSC_FILESELECT
> (http://www.dfanning.com/programs/fsc_fileselect.pro ) as part of an
> image display widget (so every time a new file name is entered, the file
> is read and the image display updated). It works fine so long as
> one uses the BROWSE button to select a file. But if the directory or
> file name is entered manually, then an event is triggered with every
> keystroke (e.g. each letter of a directory name), whereas I would only
> like an event to be triggered after the user hits [RETURN]. I
> suspect that this is a problem in my programming rather than a property
> of FSC_FILESELECT since it doesn't appear to occur in the example
> included with FSC_FILESELECT.
>
> Any ideas on what I might be doing wrong to cause this behavior? My
> call to fsc_fileselect is like this
>
> file = fsc_fileselect(control_base, event_pro='imv_filename',$
> /mustexist, filter = '*.fits', /read )
>
> where the program imv_filename reads the file and displays the image.
Wow. Here is an example of someone who wrote programs WAY TOO late
on a Friday afternoon! What could the author possibly have been
thinking!? Or drinking!?
That is one ugly SOB of a program! :-)
Ok, let me confess to a couple of youthful indiscretions and
enthusiasms. I don't know why in the world I would think to
send *all* the text events to your EVENT_PRO event handler,
but at least I had the decency to document that was what
I was doing. (See the section under the EVENT STRUCTURE
header.) I can't imagine how you would use that information.
What you see here are the incipient stages of a couple of
good ideas, poorly implemented. It is good to allow events to
be re-directed in compound widgets. Similarly, it is a fabulous
idea to write compound widgets as objects. But this, folks, is
NOT the way to do it. :-(
Oh, dear. After thinking about this for several minutes,
I'm beginning to understand what the problem was (and why
I probably didn't test it very well). Let's see... have
you thought about DIALOG_PICKFILE? :-)
> P.S. I am widget programming for the first time in 10 years so I may not
> yet be able to properly phrase the question...
Well, the first rule of thumb is not to use software from the
era in which you left off. It is practically guaranteed to
be embarrassing. :-(
Cheers,
David
P.S. I'm going to have to think what to do about this.
I suppose it's too late to disown it.
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|