canvas%
Implements: canvas<%>
A canvas% object is a general-purpose window for drawing
and handling events.
( -> new canvas% (parent _) [(style _)] [(paint-callback _)] [(label _)] [(enabled _)] [(vert-margin _)] [(horiz-margin _)] [(min-width _)] [(min-height _)] [(stretchable-width _)] [(stretchable-height _)])canvas% object
parent : frame%, dialog%, panel%, or pane% object
style = : list of symbols in null'(border control-border vscroll hscroll gl deleted no-autoclear)
paint-callback = : procedure of two arguments: a voidcanvas% object and a dc<%> object
label = : string (up to 200 characters) or #f#f
enabled = : boolean
#t
vert-margin = : exact integer in [0, 1000]
0
horiz-margin = : exact integer in [0, 1000]
0
min-width = : exact integer in [0, 10000]
0
min-height = : exact integer in [0, 10000]
0
stretchable-width = : boolean
#t
stretchable-height = : boolean#t
The style argument indicates one or more of the following styles:
'border -- gives the canvas a thin border
'control-border -- gives the canvas a border that is
like a text-field% control
'hscroll -- enables horizontal scrolling (initially inactive)
'vscroll -- enables vertical scrolling (initially inactive)
'gl -- obsolete (every canvas is an OpenGL context where supported)
'deleted -- creates the canvas as initially hidden and without affecting
parent's geometry; the canvas can be made active
later by calling parent's add-child
method
'no-autoclear -- prevents automatic erasing of the
canvas before calls to
on-paint
The 'hscroll and 'vscroll styles create a
canvas with an initially inactive scrollbar. The scrollbar is
activated with either
init-manual-scrollbars or
init-auto-scrollbars.
The paint-callback argument is called by the default
on-paint method, using the canvas and the DC returned by
get-dc as the argument.
For information about the
enabled
argument, see window<%>. For information about the
horiz-margin and vert-margin
arguments, see subarea<%>. For information about the
min-width, min-height, stretchable-width, and stretchable-height
arguments, see area<%>.
Methods
accept-tab-focus
get-dc
get-scroll-page
get-scroll-pos
get-scroll-range
get-view-start
get-virtual-size
init-auto-scrollbars
init-manual-scrollbars
min-client-height
min-client-width
on-char
on-event
on-paint
on-scroll
on-tab-in
scroll
set-scroll-page
set-scroll-pos
set-scroll-range
swap-gl-buffers
warp-pointer
with-gl-context
All Methods
accept-drop-files from window<%>
accept-tab-focus from canvas%
client->screen from window<%>
enable from window<%>
focus from window<%>
get-client-size from window<%>
get-cursor from window<%>
get-dc from canvas<%>
get-graphical-min-size from area<%>
get-height from window<%>
get-label from window<%>
get-parent from area<%>
get-plain-label from window<%>
get-scroll-page from canvas%
get-scroll-pos from canvas%
get-scroll-range from canvas%
get-size from window<%>
get-top-level-window from area<%>
get-view-start from canvas%
get-virtual-size from canvas%
get-width from window<%>
get-x from window<%>
get-y from window<%>
has-focus? from window<%>
horiz-margin from subarea<%>
init-auto-scrollbars from canvas%
init-manual-scrollbars from canvas%
is-enabled? from window<%>
is-shown? from window<%>
min-client-height from canvas<%>
min-client-width from canvas<%>
min-height from area<%>
min-width from area<%>
on-char from canvas<%>
on-drop-file from window<%>
on-event from canvas<%>
on-focus from window<%>
on-move from window<%>
on-paint from canvas<%>
on-scroll from canvas<%>
on-size from window<%>
on-subwindow-char from window<%>
on-subwindow-event from window<%>
on-superwindow-enable from window<%>
on-superwindow-show from window<%>
on-tab-in from canvas<%>
popup-menu from window<%>
refresh from window<%>
screen->client from window<%>
scroll from canvas%
set-cursor from window<%>
set-label from window<%>
set-scroll-page from canvas%
set-scroll-pos from canvas%
set-scroll-range from canvas%
show from window<%>
stretchable-height from area<%>
stretchable-width from area<%>
swap-gl-buffers from canvas%
vert-margin from subarea<%>
warp-pointer from canvas<%>
with-gl-context from canvas%