Re: changing text in textwidget from other widgets in same tree [message #8870] |
Fri, 02 May 1997 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Scott McIntosh <scott@astro.gla.ac.uk> writes:
> I am new to GUI prgramming with IDL, and does anyone know how to
> do the following.
>
> imagine:
> Load button(pickfile)
> text_widget containing path of file
>
> I would like to update the text_widget every time the file is changed, I
> know this is possible, but I cannot think about how to implement it.
In the event handler where you call PICKFILE, you want to get the
name of the file and use that to set the value of your text widget.
Your event handler will look something like this:
PRO NEWFILE_EVENT, event
; Pick new file.
filename = PICKFILE()
IF filename EQ '' THEN RETURN
Widget_Control, event.top, Get_UValue=info, /No_Copy
info.currentFilename = filename
Widget_Control, info.textWidgetID, Set_Value=filename
Widget_Control, event.top, Set_UValue=info, /No_Copy
END
Cheers!
David
P.S. I am making a lot of progress on my new IDL Programming
book. It should be out soon! It will include quite a lot of this
kind of information. :-)
----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
Customizable IDL Programming Courses
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
|
|
|