]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/menus/menus-docs.factor
bebfaf13fe4109a9f53074ceedc7de669c23a770
[factor.git] / basis / ui / gadgets / menus / menus-docs.factor
1 USING: ui.gadgets help.markup help.syntax ui.gadgets.worlds
2 kernel ;
3 IN: ui.gadgets.menus
4
5 HELP: <commands-menu>
6 { $values { "target" object } { "commands" "a sequence of commands" } { "hook" { $quotation "( button -- )" } }  { "menu" "a new " { $link gadget } } }
7 { $description "Creates a popup menu of commands which are to be invoked on " { $snippet "target" } ". The " { $snippet "hook" } " quotation is run before a command is invoked." } ;
8
9 HELP: show-menu
10 { $values { "owner" gadget } { "menu" gadget } }
11 { $description "Displays a popup menu in the " { $link world } " containing " { $snippet "owner" } " at the current mouse location. The popup menu can be any gadget." } ;
12
13 HELP: show-commands-menu
14 { $values { "target" gadget } { "commands" "a sequence of commands" } }
15 { $description "Displays a popup menu with the given commands. The commands act on the target gadget. This is just a convenience word that combines " { $link <commands-menu> } " with " { $link show-menu } "." }
16 { $notes "Useful for right-click context menus." } ;
17
18 ARTICLE: "ui.gadgets.menus" "Popup menus"
19 "The " { $vocab-link "ui.gadgets.menus" } " vocabulary displays popup menus in " { $link "ui.gadgets.glass" } "."
20 { $subsections
21     <commands-menu>
22     show-menu
23     show-commands-menu
24 } ;
25
26 ABOUT: "ui.gadgets.menus"