ExtensionA Button with Menu for performing actions. Closes on unfocus or with esc key.
Supports Button or RoundButton as a button classes.
If wslib quark is active, defaults to RoundButton.
Closes on click outside or on escape.
Create an ActionQMenu
| parent |
The parent view. |
| bounds |
A Rect |
| name |
The Menu Button Title |
| items |
An Array of String, Association (\key->function), MenuAction, or ActionQSubMenu. NOTE: items
Use a String to trigger the defaultAction (and globalAction). If a String starts with "-", it creates a menu separator. Use an Association to trigger the associated function (and globalAction). Use a MenuAction to customize all aspects of the menu, and trigger the associated action (and globalAction). Use a ActionQSubMenu to create a sub-menu. MenuAction will give you the most customizability. |
| defaultAction |
a default action for action items, in case no action is specified. |
| globalAction |
a global action which is run for any item. |
| useDefaultFont |
if your item is a , override its font with menu font. defaults to true. If you want to completely customize MenuAction items, set it to false; |
| showArrow |
show a little down-tick arrow, defaults to true |
an ActionMenu
Create an ActionQMenu without the trigger button, so you can attach the menu to MainMenu
See code examples below.
| name |
The Menu Button Title |
| items |
An Array of String, Association (\key->function), MenuAction, or ActionQSubMenu. NOTE: items
Use a String to trigger the defaultAction (and globalAction). If a String starts with "-", it creates a menu separator. Use an Association to trigger the associated function (and globalAction). Use a MenuAction to customize all aspects of the menu, and trigger the associated action (and globalAction). Use a ActionQSubMenu to create a sub-menu. WARNING: When registering with MainMenu, "-" cannot be repeated without adding a unique name (which is not rendered)
MenuAction will give you the most customizability. |
| defaultAction |
a default action for action items, in case no action is specified. |
| globalAction |
a global action which is run for any item. |
an ActionMenu without the trigger button (for attaching to MainMenu)
Default: Button.
but you can use the RoundButton from the wonderful wslib quark.
If wslib quark is active, defaults to RoundButton.
the Button class.
a function. if you a add only a string, not an association, this function will be used.
the menu Button
the Menu
add an item: String, Association (\key->function), MenuAction.
MenuAction will give you the most customizability.
insert an item. before: A MenuAction or in index integer item: String, Association (\key->function), MenuAction. MenuAction will give you the most customizability.
a global function to be evaluated on selection
(describe returnvalue here)
set a tooltip for the menu button
default 6.5
Use a String to trigger the defaultAction (and globalAction).
If a String starts with "-", it creates a menu separator.
Use an Association to trigger the associated function (and globalAction).
Use a MenuAction to customize all aspects of the menu, and trigger the associated action (and globalAction).
Use a ActionQSubMenu to create a sub-menu.