ExtensionAn ActionQMenu, where string entries are interpreted as file/folder paths.
A folder works multi-level, listing subfolders.
You can still add \key->action associations,ActionQSubMenu,or a MenuAction just like in ActionQMenu.
Closes on click outside or on escape key.
Create an ActionMenu
| 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
A String is interpreted as file or folder paths (except if they start with "-"); A String ending in "/*" will iterated over the files in the directory on the top level. 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. |
| defaultAction |
a default action, in case not 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; |
| lazyLoad |
default: defaultLazyLoad. lazy load the submenus. False makes menu items more respnsive. Caution: false can slow things down with large directories and subdirectories. |
| showArrow |
show a little down-tick arrow, defaults to true |
an ActionQMenu
Create an ActionMenu 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
A String is interpreted as file or folder paths (except if they start with "-"); A String ending in "/*" will iterated over the files in the directory on the top level. 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) |
| defaultAction |
a default action, in case not action is specified. |
| globalAction |
a global action which is run for any item. |
| lazyLoad |
default: defaultLazyLoad. lazy load the submenus. False makes menu items more respnsive. Caution: false can slow things down with large directories and subdirectories. |
an ActionQMenu without a trigger button
Default: ["rtf","rtfd","sc","scd","html","HTML","schelp"]
a default function you can set for all items.
{|path,action,what,val| doSomething()}
default: true. Preload the submenus. Makes menu items more respnsive. Caution: can slow things down with large directories.
Default: ["rtf","rtfd","sc","scd","html","HTML","schelp"]
a function run on the selected path. Typically open a file.
{|path,action,what,val| doSomething()}
for action,what,val, see Menu
You can set it on the instance, or you can set a default with PathActionMenu.defaultOpenAction
A String is interpreted as file or folder paths (except if they start with "-");
A String ending in "/*" will iterated over the files in the directory on the top level.
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.