17. Page interface of views and controls#
Status: approved by the author, 2026-11-13. Not built yet.
17.1. Rules#
Reading. Each element (
mtp-model, every view and every control) shows its own page state on itself asdata-mtp-…attributes: present or absent for a yes/no state, a value otherwise. Every change of its page state fires onemtp-stateevent on that element.Scene values are not page state. They are never shown as attributes. A script reads them from
<mtp-model>and never writes them.Driving. A script acts on an element only through its inputs, as a reader does. Each piece of an element the reader presses, clicks or drags is an input and carries
data-mtp-input="name", the name unique within its element. No element has methods that change it. To start again, a script reloads the page.Names. Every attribute carries the
data-mtp-prefix.
17.2. What follows for each kind#
Element |
Attributes (each |
Inputs ( |
|---|---|---|
|
|
none |
canvas, display, readout |
|
|
button |
|
|
toggle |
|
|
slider |
|
|
play |
|
|
stepper |
|
|
inactive is present while a control’s (active bool) does not hold. step is 0 in explore
mode, and exploring is present then.
17.3. Events#
mtp-state on each element replaces mtp-mode and mtp-rest. On <mtp-model>, mtp-change
stays, and the old mtp-ready (the model has loaded) is renamed mtp-loaded: both are about
the model and the scene, not page state.
During mtp-state on a play or a stepper, its step and playing values read from
<mtp-model> already match its attributes, or for copies, the attributes of the copy that moved
the scene last.