From 7a5309f075c813834b2fdd9eac459b5b311f5d87 Mon Sep 17 00:00:00 2001 From: Sam Anklesaria Date: Tue, 28 Jul 2009 11:40:58 -0500 Subject: [PATCH] comboboxes use frp --- extra/ui/frp/gadgets/gadgets.factor | 10 ++++----- extra/ui/gadgets/comboboxes/comboboxes.factor | 21 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/extra/ui/frp/gadgets/gadgets.factor b/extra/ui/frp/gadgets/gadgets.factor index a1287c7363..f39ca3accd 100644 --- a/extra/ui/frp/gadgets/gadgets.factor +++ b/extra/ui/frp/gadgets/gadgets.factor @@ -19,9 +19,10 @@ M: frp-table row-columns quot>> [ call( a -- b ) ] [ drop f ] if* ; M: frp-table row-value val-quot>> [ call( a -- b ) ] [ drop f ] if* ; M: frp-table row-color color-quot>> [ call( a -- b ) ] [ drop f ] if* ; -: ( model -- table ) f frp-table new-table dup >>renderer +: new-frp-table ( model class -- table ) f swap new-table dup >>renderer V{ } clone >>selected-values V{ } clone >>selected-indices* f >>actions dup [ actions>> set-model ] curry >>action ; +: ( model -- table ) frp-table new-frp-table ; : ( -- table ) V{ } clone ; : ( column-model -- table ) [ 1array ] >>quot ; : ( -- table ) V{ } clone ; @@ -52,11 +53,10 @@ M: frp-field model-changed 2dup frp-model>> = : ( -- field ) f dup [ set-control-value ] curry >>quot f >>model ; -: image-prep ( -- quot ) scan current-vocab name>> "vocab:" "/icons/" surround ".tiff" surround [ ] [ load-image ] [ ] tri - [ \ cached-image "memoize" word-prop set-at ] 3curry ; -SYNTAX: IMG-FRP-BTN: image-prep [ ] append over push-all ; +: image-prep ( -- image ) scan current-vocab name>> "vocab:" "/icons/" surround ".tiff" surround dup cached-image drop ; +SYNTAX: IMG-FRP-BTN: image-prep [ ] curry over push-all ; -SYNTAX: IMG-BTN: image-prep [ swap