canvas<%> : interface? | ||
|
To draw onto a canvas, get its device context (see get-dc).
canvas% – a canvas for arbitrary drawing and event handling
editor-canvas% – a canvas for displaying editor<%> objects
(send a-canvas accept-tab-focus) → boolean? |
(send a-canvas accept-tab-focus on?) → void? |
on? : any/c |
When tab-focus is enabled for a canvas% object, Tab, arrow, Enter, and Escape keyboard events are consumed by a frame’s default on-traverse-char method. (In addition, a dialog’s default method consumes Escape key events.) Otherwise, on-traverse-char allows the keyboard events to be propagated to the canvas.
For an editor-canvas% object, handling of Tab, arrow, Enter, and Escape keyboard events is determined by the allow-tab-exit method.
The result is #f if the canvas was created with the 'transparent style, otherwise it is always a color% object.
(send a-canvas min-client-height) → (integer-in 0 10000) |
(send a-canvas min-client-height h) → void? |
h : (integer-in 0 10000) |
The minimum height is ignored when it is smaller than the canvas’s graphical minimum height. See Geometry Management for more information.
(send a-canvas min-client-width) → (integer-in 0 10000) |
(send a-canvas min-client-width w) → void? |
w : (integer-in 0 10000) |
The minimum width is ignored when it is smaller than the canvas’s graphical minimum width. See Geometry Management for more information.
(send a-canvas on-char ch) → void? |
ch : (is-a?/c key-event%) |
Default implementation: Does nothing.
(send a-canvas on-event event) → void? |
event : (is-a?/c mouse-event%) |
Default implementation: Does nothing.
When on-paint is called in response to a system expose event and only a portion of the canvas is newly exposed, any drawing operations performed by on-paint are clipped to the newly-exposed region; however, the clipping region as reported by get-clipping-region does not change.
Default implementation: Does nothing.
See also accept-tab-focus and on-traverse-char in top-level-window<%> .
Default implementation: Does nothing.
(send a-canvas set-canvas-background color) → void? |
color : (is-a?/c color%) |
If the canvas was created with the 'transparent style, an exn:fail:contract exception is raised.
(send a-canvas set-resize-corner on?) → void? |
on? : any/c |
(send a-canvas warp-pointer x y) → void? |
x : (integer-in 0 10000) |
y : (integer-in 0 10000) |