# menu_prepare

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L546
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-menu_prepare/

```c
struct menu_data * menu_prepare(struct menu *menu, int flags, int starting_choice, struct cmdq_item *item, u_int px, u_int py, struct client *c, enum box_lines lines, const char *style, const char *selected_style, const char *border_style, struct cmd_find_state *fs, menu_choice_cb cb, void *data)
```

## Parameters

- `menu` (`struct menu *`)
- `flags` (`int`)
- `starting_choice` (`int`)
- `item` (`struct cmdq_item *`)
- `px` (`u_int`)
- `py` (`u_int`)
- `c` (`struct client *`)
- `lines` (`enum box_lines`)
- `style` (`const char *`)
- `selected_style` (`const char *`)
- `border_style` (`const char *`)
- `fs` (`struct cmd_find_state *`)
- `cb` (`menu_choice_cb`)
- `data` (`void *`)

## Called by

- [`menu_display`](/en/tmux/3.7c/reference/c-function-menu_display/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L637)
- [`popup_key_cb`](/en/tmux/3.7c/reference/c-function-popup-c-popup_key_cb/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/popup.c#L659)

## Calls

- [`cmd_find_copy_state`](/en/tmux/3.7c/reference/c-function-cmd_find_copy_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L580)
- [`options_get_number`](/en/tmux/3.7c/reference/c-function-options_get_number/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L565)
- [`screen_init`](/en/tmux/3.7c/reference/c-function-screen_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L581)
- [`xcalloc`](/en/tmux/3.7c/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L567)
- [`xstrdup`](/en/tmux/3.7c/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L573)

## Referenced declarations

- [`menu_data.border_lines`](/en/tmux/3.7c/reference/c-struct-menu_data-border_lines/) (attribute)
- [`menu_data.border_style`](/en/tmux/3.7c/reference/c-struct-menu_data-border_style/) (attribute)
- [`box_lines`](/en/tmux/3.7c/reference/c-enum-box_lines/) (enum)
- [`BOX_LINES_DEFAULT`](/en/tmux/3.7c/reference/c-enum-box_lines-box_lines_default/) (constant)
- [`menu_data.cb`](/en/tmux/3.7c/reference/c-struct-menu_data-cb/) (attribute)
- [`menu_data.choice`](/en/tmux/3.7c/reference/c-struct-menu_data-choice/) (attribute)
- [`client`](/en/tmux/3.7c/reference/c-struct-client/) (struct)
- [`cmd_find_state`](/en/tmux/3.7c/reference/c-struct-cmd_find_state/) (struct)
- [`cmdq_item`](/en/tmux/3.7c/reference/c-struct-cmdq_item/) (struct)
- [`menu.count`](/en/tmux/3.7c/reference/c-struct-menu-count/) (attribute)
- [`session.curw`](/en/tmux/3.7c/reference/c-struct-session-curw/) (attribute)
- [`menu_data.data`](/en/tmux/3.7c/reference/c-struct-menu_data-data/) (attribute)
- [`menu_data.flags`](/en/tmux/3.7c/reference/c-struct-menu_data-flags/) (attribute)
- [`menu_data.fs`](/en/tmux/3.7c/reference/c-struct-menu_data-fs/) (attribute)
- [`menu_data.item`](/en/tmux/3.7c/reference/c-struct-menu_data-item/) (attribute)
- [`menu.items`](/en/tmux/3.7c/reference/c-struct-menu-items/) (attribute)
- [`menu`](/en/tmux/3.7c/reference/c-struct-menu/) (struct)
- [`menu_data.menu`](/en/tmux/3.7c/reference/c-struct-menu_data-menu/) (attribute)
- [`menu_choice_cb`](/en/tmux/3.7c/reference/c-typedef-menu_choice_cb/) (typealias)
- [`menu_data`](/en/tmux/3.7c/reference/c-struct-menu_data/) (struct)
- [`MENU_NOMOUSE`](/en/tmux/3.7c/reference/c-define-tmux-h-menu_nomouse/) (constant)
- [`screen.mode`](/en/tmux/3.7c/reference/c-struct-screen-mode/) (attribute)
- [`MODE_CURSOR`](/en/tmux/3.7c/reference/c-define-tmux-h-mode_cursor/) (constant)
- [`MODE_MOUSE_ALL`](/en/tmux/3.7c/reference/c-define-tmux-h-mode_mouse_all/) (constant)
- [`MODE_MOUSE_BUTTON`](/en/tmux/3.7c/reference/c-define-tmux-h-mode_mouse_button/) (constant)
- [`menu_item.name`](/en/tmux/3.7c/reference/c-struct-menu_item-name/) (attribute)
- [`window.options`](/en/tmux/3.7c/reference/c-struct-window-options/) (attribute)
- [`menu_data.px`](/en/tmux/3.7c/reference/c-struct-menu_data-px/) (attribute)
- [`menu_data.py`](/en/tmux/3.7c/reference/c-struct-menu_data-py/) (attribute)
- [`menu_data.s`](/en/tmux/3.7c/reference/c-struct-menu_data-s/) (attribute)
- [`menu_data.selected_style`](/en/tmux/3.7c/reference/c-struct-menu_data-selected_style/) (attribute)
- [`client.session`](/en/tmux/3.7c/reference/c-struct-client-session/) (attribute)
- [`menu_data.style`](/en/tmux/3.7c/reference/c-struct-menu_data-style/) (attribute)
- [`tty.sx`](/en/tmux/3.7c/reference/c-struct-tty-sx/) (attribute)
- [`tty.sy`](/en/tmux/3.7c/reference/c-struct-tty-sy/) (attribute)
- [`client.tty`](/en/tmux/3.7c/reference/c-struct-client-tty/) (attribute)
- [`menu.width`](/en/tmux/3.7c/reference/c-struct-menu-width/) (attribute)
- [`winlink.window`](/en/tmux/3.7c/reference/c-struct-winlink-window/) (attribute)
