comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » resizing draw widget
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
resizing draw widget [message #10534] Wed, 17 December 1997 00:00 Go to next message
Cathy Campo is currently offline  Cathy Campo
Messages: 7
Registered: October 1997
Junior Member
i am trying to resize a draw widget. when i originally create the
base and draw widget, i do this

base = widget_base(title='Data', xoffset=xoffset, yoffset=yoffset, $
/column, xsize=x_scroll_size)
draw = widget_draw(base, /scroll, x_scroll_size=x_scroll_size, $
y_scroll_size=y_scroll_size, retain=2, xsize=xsize, ysize=ysize)

when i want to resize the draw widget, i recalculate a new xsize,
ysize, then i do this

; adjust size of drawable area
widget_control, draw, draw_xsize=xsize, draw_ysize=ysize
; adjust viewport size
widget_control, draw, xsize=x_scroll_size, ysize=y_scroll_size
; adjust base size
widget_control, base, size=x_scroll_size

the base is resizing correctly, but the draw widget is staying the
old size. any suggestions?

Cathy Campo
General Atomics
San Diego, CA
campo at gav dot gat dot com
phone (619) 455-3340
Re: resizing draw widget [message #10676 is a reply to message #10534] Thu, 18 December 1997 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Cathy Campo (campo@gav.gat.com) writes:

> i am trying to resize a draw widget. when i originally create the
> base and draw widget, i do this
>
> base = widget_base(title='Data', xoffset=xoffset, yoffset=yoffset, $
> /column, xsize=x_scroll_size)
> draw = widget_draw(base, /scroll, x_scroll_size=x_scroll_size, $
> y_scroll_size=y_scroll_size, retain=2, xsize=xsize, ysize=ysize)
>
> when i want to resize the draw widget, i recalculate a new xsize,
> ysize, then i do this
>
> ; adjust size of drawable area
> widget_control, draw, draw_xsize=xsize, draw_ysize=ysize
> ; adjust viewport size
> widget_control, draw, xsize=x_scroll_size, ysize=y_scroll_size
> ; adjust base size
> widget_control, base, size=x_scroll_size
>
> the base is resizing correctly, but the draw widget is staying the
> old size. any suggestions?

I'm unclear from your description exactly what you are
trying to do. If you have new xsize and ysize values
(larger), but the same x_scroll_size and y_scroll_size
values, then what you have done in the code above is
resized the draw widget canvas (drawing area) and left its
viewport size the same. In this case, the draw widget would
not appear to change size on the display, although it
would certainly have more drawing area (i.e., it is
larger than it was before.)

I presume from your complaint that this is not what you
intended to do. If you want to leave the drawing area
or canvas the same size, but make the view into the
drawing area (viewport) larger, then set the XSize and
YSize keywords to the new sizes.

This is all made more complicated than it needs to be by
the fact that the keywords XSIZE and YSIZE size the canvas
or drawing area when used with WIDGET_DRAW, but size the
viewport when used with WIDGET_CONTROL. (Uh, don't ask me
why, I don't know.)

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Object-Oriented Programming Question
Next Topic: Mouse and keyboard events in a draw widget

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:39:33 PDT 2025

Total time taken to generate the page: 0.00539 seconds