Re: Widget programing - Please help! [message #85860 is a reply to message #85854] |
Sat, 14 September 2013 06:25  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Khaldanr writes:
> I am writing a simple widget program in IDL where the user is to select between two files: file one and file two.
Well, as Moe from the Three Stooges would say, I think you are doing
this "All wrong!" :-)
I think what you are trying to write here is a pop-up dialog widget, in
which you ask a user to choose something and you return the choice so
the rest of the program can operate with that choice. If so, this is an
extremely awkward and inflexible way to write the program, as you are
discovering.
You will have more luck, I think, by following the advice in this
article:
http://www.idlcoyote.com/widget_tips/popup.html
Also, I would advise you NOT to issue the error message you think you
want to offer if the user doesn't select a file. There are many reasons
for not selecting a file. Forcing a user to make a selection he has
decided he doesn't want to make is not a good way to make friends among
users of your software. If a selection isn't made, just do nothing. Give
the user a minute to think. They will either make the selection of their
own free will, or they will exit the program. But, they won't blame you
for writing lousy software. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|