PRO SpinTest_Event, event ; Which windget caused the event? Widget_Control, event.id, Get_UValue=widgetUValue CASE widgetUValue OF 'QUIT': Widget_Control, event.top, /Destroy 'VALUE': BEGIN Widget_Control, event.top, Get_UValue=info, /No_Copy value = info.values(event.index) incrementIndex = Widget_Info(info.initDropID, /DropList_Select) increment = info.increments(incrementIndex) Widget_Control, info.spinner, Set_Value=[value, increment] Widget_Control, event.top, Set_UValue=info, /No_Copy END 'INCREMENT': BEGIN Widget_Control, event.top, Get_UValue=info, /No_Copy increment = info.increments(event.index) valueIndex = Widget_Info(info.valueDropID, /DropList_Select) value = info.values(valueIndex) Widget_Control, info.spinner, Set_Value=[value, increment] Widget_Control, event.top, Set_UValue=info, /No_Copy END 'CALCULATIONS': BEGIN Widget_Control, event.top, Get_UValue=info, /No_Copy Widget_Control, info.spinner, Get_Value=currentValue Widget_Control, info.times1textid, Set_Value=StrTrim(currentValue,2) Widget_Control, info.times10textid, Set_Value=StrTrim(currentValue * 10, 2) Widget_Control, event.top, Set_UValue=info, /No_Copy END 'SPINNER': BEGIN Widget_Control, event.top, Get_UValue=info, /No_Copy Widget_Control, info.times1textid, Set_Value=StrTrim(event.spinner,2) Widget_Control, info.times10textid, Set_Value=StrTrim(event.spinner * 10, 2) Widget_Control, event.top, Set_UValue=info, /No_Copy END ENDCASE END PRO SpinTest ; This is a program to test whether the spinner program CW_Spin ; can get and set values appropriately. tlb = Widget_Base(Column=1, Title='SpinTest', Align_Left=1) spinBase = Widget_Base(tlb, Column=1, Frame=1, Scr_XSize=250) spinLabel = Widget_Label(spinBase, Value='This is Your Spinner!') spinner = CW_Spin(spinBase, Value=0, Increment=1, UValue='SPINNER') setBase = Widget_Base(tlb, Column=1, Frame=1, Scr_XSize=250) setLabel = Widget_Label(setBase, Value='Set Spinner Properties') initValues = [ 0, 50, 100, 150, 200] initIncrements = [1, 2, 5, 10, 50] valueDropID = Widget_Droplist(setBase, Value=StrTrim(initValues,2), $ Title='Initial Value ', UValue='VALUE') initDropID = Widget_Droplist(setBase, Value=StrTrim(initIncrements,2), $ Title='Increment ', UValue='INCREMENT') getBase = Widget_Base(tlb, Column=1, Frame=1, Scr_XSize=250) calc = Widget_Button(getBase, Value='Do Spinner Calculations...', UVALUE='CALCULATIONS') times1B = Widget_Base(getBase, Row=1) times1L = Widget_Label(times1B, Value='Spinner Value =', Scr_XSize=150) times1TextID = Widget_Text(times1B, Value='0', Scr_XSize=50) times10B = Widget_Base(getBase, Row=1) times10L = Widget_Label(times10B, Value='Spinner Value * 10 =', Scr_XSize=150) times10TextID = Widget_Text(times10B, Value='0', Scr_XSize=50) quitter = Widget_Button(tlb, Value='Quit', UValue='QUIT') info={times1TextID:times1TextID, times10TextID:times10TextID, $ valueDropID:valueDropID, initDropID:initDropID, $ values:initValues, increments:initIncrements, spinner:spinner} Widget_Control, tlb, /Realize, Set_UValue=info, /No_Copy XManager, 'spintest', tlb END