]> gitweb.factorcode.org Git - factor.git/blob - basis/models/delay/delay-docs.factor
core, basis, extra: Remove DOS line endings from files.
[factor.git] / basis / models / delay / delay-docs.factor
1 USING: help.syntax help.markup kernel math classes classes.tuple
2 calendar models ;
3 IN: models.delay
4
5 HELP: delay
6 { $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 " { $link <delay> } "." }
7 { $examples
8     "The following code displays a sliders and a label which is updated half a second after the slider stops changing:"
9     { $code
10         "USING: models models.delay models.arrow models.range"
11         "ui ui.gadgets ui.gadgets.labels ui.gadgets.sliders"
12         "ui.gadgets.panes math.parser calendar ;"
13         ""
14         "<pile>"
15         "0 10 0 100 1 <range>"
16         "[ horizontal <slider> add-gadget ]"
17         "["
18         "    1/2 seconds <delay>"
19         "    [ unparse ] <arrow>"
20         "    <label-control> add-gadget"
21         "] bi"
22         "\"Test\" open-window"
23     }
24 } ;
25
26 HELP: <delay>
27 { $values { "model" model } { "timeout" duration } { "delay" delay } }
28 { $description "Creates a new instance of " { $link delay } ". The timeout must elapse from the time the underlying model last changed to when the delay model value is changed and its connections are notified." }
29 { $examples "See the example in the documentation for " { $link delay } "." } ;
30
31 ARTICLE: "models-delay" "Delay models"
32 "Delay models are used to implement delayed updating of gadgets in response to user input."
33 { $subsections
34     delay
35     <delay>
36 } ;
37
38 ABOUT: "models-delay"