init-auto-scrollbars in canvas%
Enables and initializes automatic scrollbars for the canvas. A
horizontal or vertical scrollbar can be activated only in a canvas
that was created with the 'hscroll or
'vscroll style flag, respectively.
With automatic scrollbars, the programmer specifies the desired virtual size of the canvas, and the scrollbars are automatically handled to allow the user to scroll around the virtual area.
See also
init-manual-scrollbars for information about manual scrollbars. The horizontal and vertical
scrollbars are always either both manual or both automatic, but they
are independently enabled. Automatic scrollbars can be
re-initialized as manual, and vice-versa.
( -> void
send a-canvas init-auto-scrollbars horiz-pixels vert-pixels h-value v-value)
horiz-pixels : exact integer in [1, 10000] or #f
vert-pixels : exact integer in [1, 10000] or #f
h-value : real number in [0.0, 1.0]
v-value : real number in [0.0, 1.0]
Initializes the scrollbars and resets the canvas's virtual size to the
given values. If either horiz-pixels or vert-pixels is
#f, the scrollbar is not enabled in the corresponding
direction, and the canvas's virtual size in that direction is the
same as its client size.
The h-value and v-value arguments specify the initial
values of the scrollbars as a fraction of the scrollbar's range. A
0.0 value initializes the scrollbar to its left/top, while a
1.0 value initializes the scrollbar to its right/bottom.
See also
on-scroll and
get-virtual-size.