: top-recipes ( offset search -- recipes ) <query> T{ recipe } rot >>title >>tuple
"votes" >>order 30 >>limit swap >>offset get-tuples ;
: top-genres ( -- genres ) f f top-recipes [ genre>> ] map prune 4 (head-slice) ;
-: <image-button> ( str -- button ) "vocab:recipes/icons/" ".tiff" surround <image-name> <frp-button> ;
: interface ( -- book ) [
[
-USING: accessors arrays kernel models monads ui.frp.signals ui.gadgets
-ui.gadgets.buttons ui.gadgets.buttons.private ui.gadgets.editors
-ui.gadgets.tables sequences splitting ui.gadgets.labels
-ui.gadgets.scrollers ui.gadgets.borders ;
+USING: accessors arrays kernel models monads
+sequences ui.frp.signals ui.gadgets ui.gadgets.borders
+ui.gadgets.buttons ui.gadgets.buttons.private
+ui.gadgets.editors ui.gadgets.labels ui.gadgets.scrollers
+ui.gadgets.tables ui.images vocabs.parser ;
IN: ui.frp.gadgets
-
TUPLE: frp-button < button hook value ;
: <frp-button> ( gadget -- button ) [
[ dup hook>> [ call( button -- ) ] [ drop ] if* ]
: <frp-action-field> ( -- field ) f <action-field> dup [ set-control-value ] curry >>quot
f <model> >>model ;
+: image-button ( filename path -- button ) ".tiff" surround <image-name> <frp-button> ;
+SYNTAX: <image-button> current-vocab name>> "vocab:" "/icons/" surround
+ [ image-button ] curry over push-all ;
+
GENERIC: output-model ( gadget -- model )
M: gadget output-model model>> ;
M: table output-model dup multiple-selection?>>