pro get_text,in_text,out_text,LABEL=label ;------------------------------------------------------------------- ; Program: get_text ; ; Version: 1.0 ; ; Date: March 2004 ; ; Purpose/Function: ; This procedure creates a text input GUI ; and returns the entered text ; ; Parameters: ; input in_text string initial value for text field ; output out_text string value obtained from text field ; ; Keywords: ; label string title/prompt string for the GUI ; ; Invocation: idl> get_text, "inital text",final_text ; ; ; Language/Compiler Version: ; This routine has been tested on the systems listed below. ; Computer Operating System IDL Version ; --------------- ---------------- ----------- ; PC Windows 2000 6.0 ; ; ;------------------------------------------------------------------- common textblock,text ; create a GUI base tbase = WIDGET_BASE(/column) ; create the text field with label ttext = CW_FIELD(tbase,TITLE=label,VALUE=in_text,UNAME="get_text",XSIZE=50) ; create a DONE button done = widget_button(tbase,value="DONE",UVALUE="done",UNAME="text_done") WIDGET_CONTROL,tbase,/REALIZE WIDGET_CONTROL,tbase,SET_UVALUE=ttext XMANAGER,'get_text',tbase ; control returns here when GUI is destroyed out_text = text[0] return end