# _M.textadept.menu

Defines the menus used by Textadept.
If applicable, load this module last in your *~/.textadept/init.lua*, after
`_M.textadept.keys` since it looks up defined key commands to show them in
menus.

- - -

## Functions

- - -

<a id="select_command"></a>
### `select_command`()

Prompts the user to select a menu command to run.

- - -

<a id="set_contextmenu"></a>
### `set_contextmenu`(*menu*)

Sets `gui.context_menu` from *menu*, an ordered list of menu items.
Menu items are tables containing menu text and either a function to call or
a table containing a function with its parameters to call when an item is
clicked. Menu items may also be sub-menus, ordered lists of menu items with
an additional `title` key for the sub-menu's title text.

Parameters:

* *`menu`*: The menu table to create the context menu from.

See also:

* [`gui.context_menu`](gui.html#context_menu)
* [`gui.menu`](gui.html#menu)

- - -

<a id="set_menubar"></a>
### `set_menubar`(*menubar*)

Sets `gui.menubar` from *menubar*, a table of menus.
Each menu is an ordered list of menu items and has a `title` key for the
title text. Menu items are tables containing menu text and either a function
to call or a table containing a function with its parameters to call when an
item is clicked. Menu items may also be sub-menus, ordered lists of menu
items with an additional `title` key for the sub-menu's title text.

Parameters:

* *`menubar`*: The table of menu tables to create the menubar from.

See also:

* [`gui.menubar`](gui.html#menubar)
* [`gui.menu`](gui.html#menu)

- - -


