# menu_add_item

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

```c
void menu_add_item(struct menu *menu, const struct menu_item *item, struct cmdq_item *qitem, struct client *c, struct cmd_find_state *fs)
```

## Parameters

- `menu` (`struct menu *`)
- `item` (`const struct menu_item *`)
- `qitem` (`struct cmdq_item *`)
- `c` (`struct client *`)
- `fs` (`struct cmd_find_state *`)

## Called by

- [`cmd_display_menu_exec`](/en/tmux/latest/reference/c-function-cmd-display-menu-c-cmd_display_menu_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-display-menu.c#L330)
- [`menu_add_items`](/en/tmux/latest/reference/c-function-menu_add_items/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L60)
- [`status_prompt_complete_list_menu`](/en/tmux/latest/reference/c-function-status-c-status_prompt_complete_list_menu/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/status.c#L1994)
- [`status_prompt_complete_window_menu`](/en/tmux/latest/reference/c-function-status-c-status_prompt_complete_window_menu/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/status.c#L2067)

## Calls

- [`format_single`](/en/tmux/latest/reference/c-function-format_single/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L91)
- [`format_single_from_state`](/en/tmux/latest/reference/c-function-format_single_from_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L89)
- [`format_trim_right`](/en/tmux/latest/reference/c-function-format_trim_right/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L119)
- [`format_width`](/en/tmux/latest/reference/c-function-format_width/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L141)
- [`key_string_lookup_key`](/en/tmux/latest/reference/c-function-key_string_lookup_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L101)
- [`xasprintf`](/en/tmux/latest/reference/c-function-xasprintf/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L121)
- [`xreallocarray`](/en/tmux/latest/reference/c-function-xreallocarray/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/menu.c#L80)

## Referenced declarations

- [`client`](/en/tmux/latest/reference/c-struct-client/) (struct)
- [`cmd_find_state`](/en/tmux/latest/reference/c-struct-cmd_find_state/) (struct)
- [`cmdq_item`](/en/tmux/latest/reference/c-struct-cmdq_item/) (struct)
- [`menu_item.command`](/en/tmux/latest/reference/c-struct-menu_item-command/) (attribute)
- [`menu.count`](/en/tmux/latest/reference/c-struct-menu-count/) (attribute)
- [`menu.items`](/en/tmux/latest/reference/c-struct-menu-items/) (attribute)
- [`menu_item.key`](/en/tmux/latest/reference/c-struct-menu_item-key/) (attribute)
- [`KEYC_NONE`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_none/) (constant)
- [`KEYC_UNKNOWN`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_unknown/) (constant)
- [`menu`](/en/tmux/latest/reference/c-struct-menu/) (struct)
- [`menu_item`](/en/tmux/latest/reference/c-struct-menu_item/) (struct)
- [`menu_item.name`](/en/tmux/latest/reference/c-struct-menu_item-name/) (attribute)
- [`tty.sx`](/en/tmux/latest/reference/c-struct-tty-sx/) (attribute)
- [`client.tty`](/en/tmux/latest/reference/c-struct-client-tty/) (attribute)
- [`menu.width`](/en/tmux/latest/reference/c-struct-menu-width/) (attribute)
