Widget_text issue [message #54377] |
Fri, 01 June 2007 10:53 |
ryanselk
Messages: 16 Registered: May 2007
|
Junior Member |
|
|
Hey, Im trying to have a textbox that simply returns (as a string to
the cmd line) whatever value the user puts in a text box.
I have the text box working, but I dont know how to get it so that
once the user types it in it goes to the cmd line. I'm unsure if the
get_value ive used in the case statement is correct but I cant seem to
find a good explaination of it..
here is my code:
PRO experiment_event, ev ;
event handler
widget_control, ev.id, get_uvalue=uvalue ;
get the uvalue
CASE uvalue OF ;
choose case
'go' : print, 'GO' ; GO
button ; graphics event
'Quit': widget_control, ev.top, /destroy
'text' : BEGIN
WIDGET_CONTROL, GET_VALUE=value
print, value
END ;need this end for the BEGIN statement.
END
END
PRO experiment
main = widget_base (title='TEST GUI', /row)
cntl = widget_base (main, /column)
btn = widget_button (cntl, uvalue='go', value='GO')
quitbut = widget_button (cntl, uvalue='Quit', value='Quit') ; GO
button
widget_control, main, /realize ;
create the widgets
xmanager, 'experiment', main, /no_block ;
wait for events
wt = WIDGET_TEXT(cntl, XSIZE=15, uvalue='text',/EDITABLE) ;;works.
END
Thanks for any help! Sorry for the likely easy question, im still new
to this stuff.
|
|
|