Widget Button question [message #87122] |
Wed, 08 January 2014 16:28  |
troydporter13
Messages: 5 Registered: January 2014
|
Junior Member |
|
|
Hi,
I have a widget that has a set of non exclusive buttons;
options=['A', 'B', 'C', 'Select All']
bgroup=cw_bgroup( base, options, row=1, /nonexclusive, xoff=20, yoff= 75, uvalue='station_name' , SET_VALUE=[0,0,0,1], LABEL_Left='Select Option: ')
Is it possible to make it so that if the user clicks the 'Select All' button, the other buttons (A, B and C) cannot also be selected?
ATM you can click 'Select All' and also A, B or C which I would like to avoid.
Regards,
Troy
|
|
|
|
|
Re: Widget Button question [message #87133 is a reply to message #87126] |
Thu, 09 January 2014 06:19  |
Matthew Argall
Messages: 286 Registered: October 2011
|
Senior Member |
|
|
> How do I pick the 3 buttons I want though? I can't use bgroupas I get a message that the variable is undefined.
There are several ways of doing this. Here is one...
Use the RETURN_NAME and IDS keywords in CW_BGroup.
Store the widget IDs in the state variable of the widget.
Within the event handler, check to see if Event.Value is "Select All" (or whatever you named the select all button). If it is, cycle through the IDs in the state variable, making them insensitive (be sure to skip over the "Select All" button). Use the Get_Value keyword to Widget_Control to retrieve the names of the buttons, if need be.
|
|
|