]> gitweb.factorcode.org Git - factor.git/blob - basis/models/compose/compose-docs.factor
0f88499618feaa30562ab691ea952d2cbcc2383b
[factor.git] / basis / models / compose / compose-docs.factor
1 USING: help.syntax help.markup kernel math classes classes.tuple\r
2 calendar models ;\r
3 IN: models.compose\r
4 \r
5 HELP: compose\r
6 { $class-description "Composed model values are computed by collecting the values from a sequence of underlying models into a new sequence. Composed models are automatically updated when underlying models change. Composed models are constructed by " { $link <compose> } "."\r
7 $nl\r
8 "A composed model whose children are all " { $link "models-range" } " conforms to the " { $link "range-model-protocol" } " and represents a point in n-dimensional space which is bounded by a rectangle." }\r
9 { $examples\r
10     "The following code displays a pair of sliders, and an updating label showing their current values:"\r
11     { $code\r
12         "USING: models ui.gadgets.labels ui.gadgets.sliders ui.gadgets.panes ;"\r
13         ": <funny-slider> <x-slider> 100 over set-slider-max ;"\r
14         "<funny-slider> <funny-slider> 2array"\r
15         "dup make-pile gadget."\r
16         "dup [ gadget-model ] map <compose> [ unparse ] <filter>"\r
17         "<label-control> gadget."\r
18     }\r
19 } ;\r
20 \r
21 HELP: <compose>\r
22 { $values { "models" "a sequence of models" } { "compose" "a new " { $link compose } } }\r
23 { $description "Creates a new instance of " { $link compose } ". The value of the new compose model is obtained by mapping the " { $snippet "value" } " slot accessor over the given sequence of models." }\r
24 { $examples "See the example in the documentation for " { $link compose } "." } ;\r
25 \r
26 ARTICLE: "models-compose" "Composed models"\r
27 "Composed model values are computed by collecting the values from a sequence of underlying models into a new sequence."\r
28 { $subsection compose }\r
29 { $subsection <compose> } ;\r
30 \r
31 ABOUT: "models-compose"\r