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