Handbook
Glossary
factorcode.org
<commands-menu> ( target hook commands -- menu )
Factor handbook
»
UI framework
»
Building user interfaces
»
Pre-made UI gadgets
»
Popup menus
Next:
show-menu ( owner menu -- )
Vocabulary
ui.gadgets.menus
Inputs
target
an
object
hook
a
quotation
with stack effect
( button -- )
commands
a sequence of commands
Outputs
menu
a new
gadget
Word description
Creates a popup menu of commands which are to be invoked on
target
. The
hook
quotation is run before a command is invoked.
Definition
USING:
kernel
sequences
;
IN:
ui.gadgets.menus
:
<commands-menu>
( target hook commands -- menu )
[
<menu-item>
]
2with
map
<menu>
;