|
Re: Widget_text issue [message #54374 is a reply to message #54348] |
Fri, 01 June 2007 11:29  |
cmancone
Messages: 30 Registered: May 2007
|
Member |
|
|
On Jun 1, 2:13 pm, David Fanning <d...@dfanning.com> wrote:
> ryans...@gmail.com writes:
>> Thanks for any help! Sorry for the likely easy question, im still new
>> to this stuff.
>
> You will probably find this article interesting:
>
> http://www.dfanning.com/widget_tips/popup.html
>
> At least it will point out the things you are doing wrong. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
I got the following to work, althought it is a blocking program:
PRO experiment_event,
ev ;event handler
widget_control, ev.id, get_value=value
widget_control, ev.top, get_uvalue=info
if value eq 'Quit' then begin
widget_control, info.wt, get_value=text
*info.ptr = text
widget_control, ev.top, /destroy
endif
END
PRO experiment,value
main = widget_base (title='TEST GUI', /row)
cntl = widget_base (main, /column)
quitbut = widget_button (cntl, value='Quit') ; GO button\
wt = WIDGET_TEXT(cntl, XSIZE=15, uvalue='text',/EDITABLE) ;;works.
ptr = ptr_new(text)
info = {wt:wt, ptr:ptr}
widget_control, main, /
realize ;create the widgets
widget_control, main, set_uvalue=info
xmanager, 'experiment', main ; wait for
events
value = *ptr
END
experiment,res
; (insert 'test string', then hit quit)
print,res
; prints 'test string'
|
|
|
|