]> gitweb.factorcode.org Git - factor.git/blob - basis/models/delay/delay-docs.factor
docs: change $subsection to $subsections
[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.gadgets ui.gadgets.labels ui.gadgets.sliders ui.gadgets.panes"\r
12         "math.parser calendar ;"\r
13         ""\r
14         ": <funny-slider> ( -- slider )"\r
15         "    0 10 0 100 <range> horizontal <slider> ;"\r
16         ""\r
17         "<funny-slider> dup gadget."\r
18         "model>> 1/2 seconds <delay> [ unparse ] <arrow>"\r
19         "<label-control> gadget."\r
20     }\r
21 } ;\r
22 \r
23 HELP: <delay>\r
24 { $values { "model" model } { "timeout" duration } { "delay" delay } }\r
25 { $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
26 { $examples "See the example in the documentation for " { $link delay } "." } ;\r
27 \r
28 ARTICLE: "models-delay" "Delay models"\r
29 "Delay models are used to implement delayed updating of gadgets in response to user input."\r
30 { $subsections\r
31     delay\r
32     <delay>\r
33 } ;\r
34 \r
35 ABOUT: "models-delay"\r