USING: quotations math.functions math.parser models models.range models.filter ui ui.gadgets ui.gadgets.labels ui.gadgets.packs ui.gadgets.sliders sto ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! This is the classic temperature conversion constraint system ! example. ! ! There are two models, one for Fahrenheit and one for Celsius. ! ! Each has a corresponding control, manifest as a horizontal slider. ! ! At the end, we tie the two models together, so that when one ! changes, the other is updated. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! It's sort of not recommended to put really dynamic stuff like 'call' ! in prominent methods like 'model-changed'. However, soon Factor will ! be able to handle stuff like this in a robust fasion that won't ! bring down performance. M: callable model-changed ( model observer -- ) call ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Define the two models 50 1 32 212 sto FAHRENHEIT-RANGE-MODEL 50 1 0 100 sto CELSIUS-RANGE-MODEL ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Build the ui 1 >>fill "Fahrenheit:"