Handbook
Glossary
<model-btn> ( gadget -- button )
Vocabulary
ui
.
gadgets
.
controls
Inputs
gadget
the button's label
Outputs
button
a
button
Word description
Creates an button whose signal updates on clicks.
Definition
USING:
accessors
combinators
kernel
models.combinators
ui.gadgets
ui.gadgets.buttons
;
IN:
ui.gadgets.controls
:
<model-btn>
( gadget -- button )
[
[
dup
hook>>
[
( button -- )
call-effect
]
[
drop
]
if*
]
[
[
[
value>>
]
[
]
bi
or
]
keep
set-control-value
]
[
model>>
f
swap
value<<
]
tri
]
model-btn
new-button
f
<basic>
>>model
;