Demo UI program that shows input handling
- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| examples | ||
| scripts | ||
| .gitignore | ||
| pad.talc | ||
| README | ||
| VERSION | ||
pad: a control nobody planned, in a repository of its own, to prove that
anyone can make one. A square with a dot in it that the pointer drags
around, written outside ../toolkit against its written contract (the
WRITING A PART and THE EVENTS sections of ../toolkit/README) and
nothing else, beside two of the toolkit's standard scroll bars that
move with the dot and move it.
pad.talc the program and the control
examples/drive.talc what the regress plays at it: hover, a drag far out
of the square and the window, the drift home
examples/*.ppm the pictures expected at each step
scripts/build.sh builds pad.talc into bin/pad
scripts/regress.sh runs it under ../screen with no card and compares
Build:
scripts/build.sh
scripts/regress.sh
which need the installed toolchain (compiler on PATH), ../canvas built
(its fonts), ../look, ../toolkit, and for the regress ../screen built.
Start it from the launcher (`pad`) or the screen's -run.
WHAT IT USES, one of everything a control of one's own needs:
the pointer held from a press on the square until the release every
motion comes to it wherever the pointer went: the
dot follows out of the square, out of the window,
and back
enter and leave the dot wears a ring while the pointer is over the square
times a second press within 400 ms of the first puts the
dot in the middle
wakes let go, the dot drifts home a step every 30 ms,
each step asking for the next
a margin the layout keeps six pixels around the square
the theme's lines pad-dot's colour (the accent's when the theme has
none), pad-dot's size (from the bevel), the square's
ground style (the wells'): a theme that never heard
of a pad styles it, and one that cares adds three lines
standard parts the bars are the toolkit's, driven by the dot through
the same calls any program makes
Nothing here is privileged: the square is made with toolkit-part-create
like the toolkit's own parts, draws with the look's elements, and runs
on the same loop.