Re: double event [message #13181] |
Mon, 26 October 1998 00:00  |
Josh Stillerman
Messages: 3 Registered: October 1995
|
Junior Member |
|
|
It prints 2 messages because the buttons are 'radio' When you press one
button,
you unpress the other. Adding 'help, structure,event' to the top of
your event handler
you get the following output:
IDL> test
** Structure <a98fd8>, 5 tags, length=24, refs=1:
ID LONG 10
TOP LONG 8
HANDLER LONG 8
SELECT LONG 1
VALUE STRING '2'
you pressed 2
** Structure <a98fd8>, 5 tags, length=24, refs=1:
ID LONG 10
TOP LONG 8
HANDLER LONG 8
SELECT LONG 0
VALUE STRING '2'
you pressed 2
** Structure <a98fd8>, 5 tags, length=24, refs=1:
ID LONG 10
TOP LONG 8
HANDLER LONG 8
SELECT LONG 1
VALUE STRING '1'
you pressed 1
after pressing '2' and then '1'
josh
David Sheerin wrote:
> Can anyone tell me why the following code prints a second copy of the
> text string when I change the value of one of the exclusive buttons.
> Thanks for any replies.
>
> pro test_event, event
>
> case event.value of
> '1': print, 'you pressed 1'
> '2': print, 'you pressed 2'
> endcase
> end
>
> pro test
>
> base = widget_base ()
> base1 = widget_base (base, row = 1)
> dimension = ['1','2']
> bgroup2 = CW_BGROUP(base1,dimension, /RETURN_name,/COLUMN,/EXCLUSIVE)
>
> WIDGET_CONTROL,base,/REALIZE
> xmanager, 'test', base
>
> end
|
|
|