Handbook
Glossary
<recipe-gadget> ( -- gadget )
Vocabulary
recipes
Inputs
None
Outputs
gadget
an
object
Definition
USING:
accessors
arrays
kernel
math
models.combinators
monads
persistency
sequences
ui.gadgets.controls
ui.gadgets.layout
ui.gadgets.scrollers
ui.images
;
IN:
recipes
::
<recipe-gadget>
( -- gadget )
[
interface
<table*>
:>
tbl
"okay"
<model-border-btn>
BUTTON
->
:>
ok
T{
image-name
{
path
"vocab:recipes/icons/submit.tiff"
}
}
<model-btn>
[
store-tuple
]
>>value
TOOLBAR
->
:>
submit
T{
image-name
{
path
"vocab:recipes/icons/love.tiff"
}
}
<model-btn>
1
>>value
TOOLBAR
->
T{
image-name
{
path
"vocab:recipes/icons/hate.tiff"
}
}
<model-btn>
-1
>>value
->
2array
merge
:>
votes
T{
image-name
{
path
"vocab:recipes/icons/back.tiff"
}
}
<model-btn>
->
[
-30
]
<$
T{
image-name
{
path
"vocab:recipes/icons/more.tiff"
}
}
<model-btn>
->
[
30
]
<$
2array
merge
:>
viewed
<spacer>
<model-field*>
[
1
<layout>
,
]
[
output-model
]
bi
:>
search submit ok
[
[
drop
]
]
<$
2array
merge
[
drop
]
>>value
:>
quot viewed 0
[
+
]
fold
search ok
t
<basic>
"all"
<model-btn>
ALL
->
tbl
selection>>
votes
[
[
+
]
curry
change-votes
modify-tuple
]
2$>
4array
merge
[
drop
[
f
]
[
"%"
dup
surround
<pattern>
]
if-empty
top-recipes
]
3fmap
:>
ups ups
[
top-genres
[
<model-btn>
GENRES
->
]
map
merge
]
bind*
[
text>>
T{
recipe
}
swap
>>genre
get-tuples
]
fmap
tbl
swap
ups
2merge
>>model
[
[
title>>
]
[
genre>>
]
bi
2array
]
>>quot
{
"Title"
"Genre"
}
>>column-titles
dup
<scroller>
RECIPES
1
<layout>
,
~18 more~
]
with-interface
;