CW_BGROUP [message #21732] |
Mon, 18 September 2000 00:00  |
Christophe Marque
Messages: 11 Registered: January 1999
|
Junior Member |
|
|
Hello,
I have written a small test widget program:
There is a CW_BGROUP area with 3 exclusive buttons: A B C
When I select A, i have 'Button A Pressed', and that's OK,
then I select B, I have: 'Button A Pressed' then 'Button B Pressed'.
It seems in fact to repeat the last action before executing the current
choice.
Where is the problem ?
Thanks in Advance,
Christophe.
Here is the program:
------------------------------------------
PRO MAIN13_Event, Event
WIDGET_CONTROL,Event.Id,GET_UVALUE=Ev
;print,'EV: ',Ev
CASE Ev OF
'BGROUP2': BEGIN
;print,'Event.Value',Event.Value
CASE Event.Value OF
0: Print,'Button A Pressed'
1: Print,'Button B Pressed'
2: Print,'Button C Pressed'
ELSE: Message,'Unknown button pressed'
ENDCASE
END
'BUTTON3': BEGIN
widget_control,event.top,/destroy
END
ENDCASE
END
; DO NOT REMOVE THIS COMMENT: END MAIN13
; CODE MODIFICATIONS MADE BELOW THIS COMMENT WILL BE LOST.
PRO test_wid, GROUP=Group
IF N_ELEMENTS(Group) EQ 0 THEN GROUP=0
junk = { CW_PDMENU_S, flags:0, name:'' }
MAIN13 = WIDGET_BASE(GROUP_LEADER=Group, $
ROW=1, $
MAP=1, $
TITLE='test', $
UVALUE='MAIN13')
Btns100 = [ $
'A', $
'B', $
'C' ]
BGROUP2 = CW_BGROUP( MAIN13, Btns100, $
ROW=1, $
EXCLUSIVE=1, $
UVALUE='BGROUP2')
BUTTON3 = WIDGET_BUTTON( MAIN13, $
UVALUE='BUTTON3', $
VALUE='Quitter')
WIDGET_CONTROL, MAIN13, /REALIZE
XMANAGER, 'MAIN13', MAIN13
END
|
|
|
|