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

Home » Public Forums » archive » Re: how to "check" checkbox state?
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
Re: how to "check" checkbox state? [message #60173] Tue, 06 May 2008 11:10 Go to next message
David Fanning is currently offline  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.")
Re: how to "check" checkbox state? [message #60174 is a reply to message #60173] Tue, 06 May 2008 10:38 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On May 6, 12:23 pm, pantha <p4n...@gmail.com> wrote:
> On 6 Mai, 19:16, Vince Hradil <hrad...@yahoo.com> wrote:
>
>> bstate = widget_info(event.id,/button_set)
>
> Thanks for the quick answer!
>
> I tried it, but bstate always returns "1" even when unchecked. Could
> it be that it is designated to the button I press when I want to check
> the checkbox state?

The event.id comes from the event that is firing, so you need to
inspect it when the event.id is the checkbox event. Does that make
sense?
Re: how to "check" checkbox state? [message #60176 is a reply to message #60174] Tue, 06 May 2008 10:23 Go to previous messageGo to next message
pantha is currently offline  pantha
Messages: 3
Registered: May 2008
Junior Member
On 6 Mai, 19:16, Vince Hradil <hrad...@yahoo.com> wrote:

> bstate = widget_info(event.id,/button_set)

Thanks for the quick answer!

I tried it, but bstate always returns "1" even when unchecked. Could
it be that it is designated to the button I press when I want to check
the checkbox state?
Re: how to "check" checkbox state? [message #60177 is a reply to message #60176] Tue, 06 May 2008 10:16 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On May 6, 11:05 am, pantha <p4n...@gmail.com> wrote:
> Hello everybody,
>
> 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.
>
> 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!

bstate = widget_info(event.id,/button_set)
Re: how to "check" checkbox state? [message #60379 is a reply to message #60173] Wed, 14 May 2008 07:11 Go to previous message
pantha is currently offline  pantha
Messages: 3
Registered: May 2008
Junior Member
I've got it at last!


Thank everybody for their valuable input!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: 3D array from surfaces?
Next Topic: Re: pState structure without widgets?

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

Current Time: Wed Oct 08 16:00:26 PDT 2025

Total time taken to generate the page: 0.00662 seconds