delay
Models > Delay models
Next:<delay> ( model timeout -- delay )


Vocabulary
models.delay

Class description
Delay models have the same value as their underlying model, however the value only changes after a timer expires. If the underlying model's value changes again before the timer expires, the timer restarts. Delay models are constructed by <delay>.

Examples
The following code displays a sliders and a label which is updated half a second after the slider stops changing:
USING: models models.delay models.arrow models.range ui.gadgets ui.gadgets.labels ui.gadgets.sliders ui.gadgets.panes math.parser calendar ; : <funny-slider> ( -- slider ) 0 10 0 100 <range> horizontal <slider> ; <funny-slider> dup gadget. model>> 1/2 seconds <delay> [ unparse ] <arrow> <label-control> gadget.


Definition
USING: models ;

IN: models.delay

TUPLE: delay < model model timeout alarm ;


Methods
USING: models models.delay ;

M: delay model-activated update-delay-model ;


USING: kernel models models.delay ;

M: delay model-changed nip dup stop-delay start-delay ;