This is a value with one or more views attached.
Views like sliders and numberboxes are attached using the -addView method. Optionally one can provide a ControlSpec.
Attached views only redraw when -update is called (e.g. inside a slow running Routine). There is no need to defer these update calls and the actual redrawing will only happen if the value has changed since last call to update.
The -action function you set is independent of the views and will be called directly when the value changes (e.g. incoming data from a sensor at very high rate - the action function will be called each time while any attached views will only redraw when update is called).
Changing the value of a view using mouse or keyboard will call the action function immediately.
a Function. can be called without deferring.
get or set the current value. nothing special. normalised. action is only called if value has changed.
set value and always call action - also on repeated values. useful for button toggles.
always call action.
layout support. only latest (last) view is returned. makes adding views to layouts easier.
an array with all added views.
add a view as a dependancy. also with a spec. automatically sets up the view action function.
| view |
some view. not complex ones like RangeSlider. for those use subclasses. |
| spec |
a ControlSpec. if not provided a default one will be created. |
call at regular intervals (typically a slow fps AppClock routine). if the value has changed the view will redraw.