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

Home » Public Forums » archive » Re: forcing scroll bars in widget_draw
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: forcing scroll bars in widget_draw [message #39269 is a reply to message #39268] Mon, 10 May 2004 13:09 Go to previous messageGo to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Benjamin Hornberger wrote:
> Hi all,
>
> is there a way to force scroll bars in a draw widget even if the draw
> size is smaller than or as big as the viewport (the scroll bar should be
> inactive then)? I would like to have that because eventually the size of
> the draw area will be increased, and if the scroll bars appear just
> then, the size of the base widget would change, which is kind of ugly.
>


Hi,

You can define a 'big' drawing canvas (see XSIZE and YSIZE keywords)
with a 'small' viewing port (see X_SCROLL_SIZE and Y_SCROLL_SIZE
keywords). It doesn't work to make the canvas equal to or smaller than
the viewport (in fact, I think the canvas must be quite a bit larger
than the viewport to get scroll bars.)

The following example defines the viewport size as the image size but
defines the drawing canvas as 3 times bigger than the image size. Note
the call to WIDGET_CONTROL to change the coordinates of the viewport.

Ben


PRO ScrollTest

base = Widget_Base()

dim = [200,200]
img = BYTSCL(Hanning(Dim[0], dim[1]), top= 200B) + 55B
draw = Widget_Draw(base, $
Retain = 2, $
Xsize = dim[0] * 3, $
Ysize = dim[1] * 3, $
X_Scroll_Size = dim[0], $
Y_Scroll_Size = dim[1])

Widget_Control, base, /realize
Widget_Control, draw, Set_Draw_View = [dim[0], dim[1]]

TV, img, dim[0], dim[1]

XMANAGER, 'ScrollTest', base

END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Call_External - memory problems?
Next Topic: Call_External - memory problems?

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

Current Time: Fri Oct 10 03:45:16 PDT 2025

Total time taken to generate the page: 0.64051 seconds