Re: IDL dynamical widget resizing bugs under linux [message #32673] |
Thu, 31 October 2002 19:29 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Sandro Kan (falso@falso.it) writes:
> Im am trying to resize a text widget when the user resizes the base widget.
> I have hear of some bugs, is it? I actually use 5.3; what about
> 5.5?
>
> Here is an axample of my problem; thanks to all who will try to help me.
>
>
> Alessandro Mura
>
> ...
>
>
> pro prova2002_10_31_14_47
> w1=widget_base(uname='W1', scr_xsize=500, scr_ysize=500, $
> /tlb_size_event ,space=3 ,xpad=3 ,ypad=3,mbar=wid_base_0_mbar)
> w2 = widget_text(w1, uname='wid_text_0' $
> ,xoffset=10 ,yoffset=10 ,scr_xsize=480,scr_ysize=480 $
> ,/scroll, /all_events , editable=0, /no_copy $
> ,value='Ciao a tutti; Hello world')
> widget_control, /realize, w1
> xmanager, 'W1', w1
> end
>
> pro w1_event, event
> wwidget=event.top
> xsize=event.x-20. wwidget=event.top
> xsize=event.x-20.
> ysize=event.y-20.
> id=widget_info(wwidget,find_by_uname='wid_text_0')
> widget_control, id, scr_xsize=xsize, scr_ysize=ysize
> end
Oh, dear. You must be a disciple of the IDL GUI Builder. :-(
Try substituting "ROW=1", instead of "scr_xsize=500, scr_ysize=500"
in your widget_base command. Things will work a lot better. In
general, but especially with bases, you don't want to use explicit
sizing if you can get away with it. And never if you want resizable
widgets. Lay things out in rows and columns and let bases size
themselves to their contents.
Oh, and maybe get a good book about IDL programming. :-)
Cheers,
David
P.S. Sorry for the short answer, but I'm off to the party!!
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|