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

Home » Public Forums » archive » Re: picking an option with radio buttons
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: picking an option with radio buttons [message #82156] Wed, 21 November 2012 13:12
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
jwwright86@gmail.com writes:

> apologies if this is a silly question. I have a base widget with a number of radio buttons in a child widget, and a continue and exit button on the base widget. I want to select an option with the radio buttons, and then have the continue button display different new base widgets, like cascading windows, depending on what radio button is selected. I have found this on idl-coyote
> http://www.idlcoyote.com/widget_tips/button_selected.html
> but I don't know what an info structure is, and how to initialise a currentButton field in this info structure. Any advice would be appreciated

An info structure (some people call it a state structure)
is simply a place where people store all of the information
they are going to need to run their widget program. It is
a way of passing needed information around to the different
program modules in a widget program that need to know
the information. It is usually stored in the user value of
the top-level base widget, because this is easily accessible
in every event handler module.

info = { ...., currentButtonID:currentButtonID, ... }
Widget_Control, tlb, Set_UValue=info

In an event handler you fetch the info structure with the
information you need:

PRO MyEventHandler, event
Widget_Control, event.top, Get_UValue=info
Widget_Control, info.currentButtonID, ...

These days info structures are usually stored in a pointer
variable, so you don't have to worry about copying it in
every event handler, so:

info = Ptr_New({ ...., currentButtonID:currentButtonID, ... })
Widget_Control, tlb, Set_UValue=info

In an event handler you fetch the info structure with the
information you need:

PRO MyEventHandler, event
Widget_Control, event.top, Get_UValue=info
Widget_Control, (*info).currentButtonID, ...

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDLDoc question on properties and fields
Next Topic: Re: repeat vs. while

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

Current Time: Wed Oct 08 15:49:14 PDT 2025

Total time taken to generate the page: 0.00484 seconds