image buttons built in
parent
b8633e5e12
commit
2a26670099
|
@ -11,7 +11,6 @@ STORED-TUPLE: recipe { title { VARCHAR 100 } } { votes INTEGER } { txt TEXT } {
|
||||||
: top-recipes ( offset search -- recipes ) <query> T{ recipe } rot >>title >>tuple
|
: top-recipes ( offset search -- recipes ) <query> T{ recipe } rot >>title >>tuple
|
||||||
"votes" >>order 30 >>limit swap >>offset get-tuples ;
|
"votes" >>order 30 >>limit swap >>offset get-tuples ;
|
||||||
: top-genres ( -- genres ) f f top-recipes [ genre>> ] map prune 4 (head-slice) ;
|
: 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 ) [
|
: interface ( -- book ) [
|
||||||
[
|
[
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
USING: accessors arrays kernel models monads ui.frp.signals ui.gadgets
|
USING: accessors arrays kernel models monads
|
||||||
ui.gadgets.buttons ui.gadgets.buttons.private ui.gadgets.editors
|
sequences ui.frp.signals ui.gadgets ui.gadgets.borders
|
||||||
ui.gadgets.tables sequences splitting ui.gadgets.labels
|
ui.gadgets.buttons ui.gadgets.buttons.private
|
||||||
ui.gadgets.scrollers ui.gadgets.borders ;
|
ui.gadgets.editors ui.gadgets.labels ui.gadgets.scrollers
|
||||||
|
ui.gadgets.tables ui.images vocabs.parser ;
|
||||||
IN: ui.frp.gadgets
|
IN: ui.frp.gadgets
|
||||||
|
|
||||||
TUPLE: frp-button < button hook value ;
|
TUPLE: frp-button < button hook value ;
|
||||||
: <frp-button> ( gadget -- button ) [
|
: <frp-button> ( gadget -- button ) [
|
||||||
[ dup hook>> [ call( button -- ) ] [ drop ] if* ]
|
[ dup hook>> [ call( button -- ) ] [ drop ] if* ]
|
||||||
|
@ -54,6 +54,10 @@ M: frp-field model-changed 2dup frp-model>> =
|
||||||
: <frp-action-field> ( -- field ) f <action-field> dup [ set-control-value ] curry >>quot
|
: <frp-action-field> ( -- field ) f <action-field> dup [ set-control-value ] curry >>quot
|
||||||
f <model> >>model ;
|
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 )
|
GENERIC: output-model ( gadget -- model )
|
||||||
M: gadget output-model model>> ;
|
M: gadget output-model model>> ;
|
||||||
M: table output-model dup multiple-selection?>>
|
M: table output-model dup multiple-selection?>>
|
||||||
|
|
Loading…
Reference in New Issue