libraryextensions/canvas/lib/Canvas.xtl
Canvas.xtl -- the facade of the canvas extension: a native window showing X_eTaL arrays as pixels, with keys, clicks and frame ticks back. Import: "cv:" u_se< "Canvas" Run with xetal-x, which links canvas and serves its windows on the main thread (xetal-x --ext DIR puts this directory on XETAL_PATH). Each signature line is written out by the binding macro (lib/Ffi.xtlm).
ˡo̲pen! : Num a => Char -> a -> Int
title cv:o_pen! width height: a window that size (in points); its id.
"o_pen! : text int -> int" ᶠᶠⁱb̲ind< "canvas/open"
ˡs̲how! : (Num a, Num b) => a -> b -> Int
id cv:s_how! pixels: draw an n by m matrix (gray) or an n by m by 3 array (red, green, blue), each from 0 (dark) to 1 (bright); a Bool matrix draws its 1s white. Scaled to the window; the id.
"s_how! : int float -> int" ᶠᶠⁱb̲ind< "canvas/show"
ˡn̲ext! : Num a => a -> Char
cv:n_ext! id: the next event, waiting at most a frame (1/60 s): "frame", "key Space", "key q", "key ArrowLeft", "click ROW COL" (where in the array shown, from 1), or "close".
"n_ext! : int -> text" ᶠᶠⁱb̲ind< "canvas/next"