2006-06-27 03:26:52 -04:00
|
|
|
! Copyright (C) 2006 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
IN: gadgets-controls
|
|
|
|
USING: gadgets kernel models ;
|
|
|
|
|
|
|
|
TUPLE: control model quot ;
|
|
|
|
|
|
|
|
C: control ( model gadget quot -- gadget )
|
|
|
|
[ set-control-quot ] keep
|
|
|
|
[ set-gadget-delegate ] keep
|
|
|
|
[ set-control-model ] keep
|
|
|
|
dup model-changed ;
|
|
|
|
|
2006-06-29 04:07:10 -04:00
|
|
|
M: control graft*
|
2006-06-27 03:26:52 -04:00
|
|
|
dup control-model add-connection ;
|
|
|
|
|
2006-06-29 04:07:10 -04:00
|
|
|
M: control ungraft*
|
2006-06-27 03:26:52 -04:00
|
|
|
dup control-model remove-connection ;
|
|
|
|
|
|
|
|
M: control model-changed ( gadget -- )
|
|
|
|
[ control-model model-value ] keep
|
|
|
|
[ dup control-quot call ] keep relayout ;
|