Re: how to "check" checkbox state? [message #60173] |
Tue, 06 May 2008 11:10  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
pantha writes:
> I am writing a GUI program using the IDL GUI builder. I put a checkbox
> on the GUI, and that checkbox state should be checked when a specific
> button is pressed. The code is handled inside the x_eventcb.pro file.
>
> Question is: How can I check the state of the checkbox (checked/
> unchecked)? Can somebody give me an example?
>
> I've read through the IDL help and several topics on this newsgroup,
> but I couldn't a fitting solution for my rather simple problem.
Nor will there be in a GUI-Builder program, unfortunately.
> I know how to set the state with "Widget_control, buttonname,
> set_button = 1" but since there is no "get_button" I'm quite puzzled
> how to get the state.
>
> Any help would be greatly appreciated!
You are going to have to figure out a way to put an "info" or
"state" structure inside your widget program, which will contain
all the information you need to run your program (such as the
identifier of the checkbox button). The GUI Builder (AFAIK) never
imagined you would need such a thing, although I've never written
a widget program yet that didn't need it.
I'd ditch the GUI Builder (since it is not supported anymore
anyway) and get yourself a good book on widget programming.
You might look on my web page for one, if you are interested. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
|
|
|