# mode_tree_build

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L585
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-mode_tree_build/

```c
void mode_tree_build(struct mode_tree_data *mtd)
```

## Parameters

- `mtd` (`struct mode_tree_data *`)

## Called by

- [`mode_tree_collapse_current`](/en/tmux/3.7c/reference/c-function-mode_tree_collapse_current/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L394)
- [`mode_tree_expand`](/en/tmux/3.7c/reference/c-function-mode_tree_expand/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L423)
- [`mode_tree_expand_current`](/en/tmux/3.7c/reference/c-function-mode_tree_expand_current/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L385)
- [`mode_tree_filter_callback`](/en/tmux/3.7c/reference/c-function-mode-tree-c-mode_tree_filter_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1087)
- [`mode_tree_key`](/en/tmux/3.7c/reference/c-function-mode_tree_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1384)
- [`mode_tree_resize`](/en/tmux/3.7c/reference/c-function-mode_tree_resize/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L657)
- [`mode_tree_search_set`](/en/tmux/3.7c/reference/c-function-mode-tree-c-mode_tree_search_set/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1038)
- [`mode_tree_swap`](/en/tmux/3.7c/reference/c-function-mode-tree-c-mode_tree_swap/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L362)
- [`window_buffer_edit_close_cb`](/en/tmux/3.7c/reference/c-function-window-buffer-c-window_buffer_edit_close_cb/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-buffer.c#L504)
- [`window_buffer_init`](/en/tmux/3.7c/reference/c-function-window-buffer-c-window_buffer_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-buffer.c#L382)
- [`window_buffer_key`](/en/tmux/3.7c/reference/c-function-window-buffer-c-window_buffer_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-buffer.c#L559)
- [`window_buffer_update`](/en/tmux/3.7c/reference/c-function-window-buffer-c-window_buffer_update/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-buffer.c#L423)
- [`window_client_init`](/en/tmux/3.7c/reference/c-function-window-client-c-window_client_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L293)
- [`window_client_key`](/en/tmux/3.7c/reference/c-function-window-client-c-window_client_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L374)
- [`window_client_update`](/en/tmux/3.7c/reference/c-function-window-client-c-window_client_update/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L334)
- [`window_customize_change_current_callback`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_change_current_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L1399)
- [`window_customize_change_tagged_callback`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_change_tagged_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L1419)
- [`window_customize_init`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L919)
- [`window_customize_key`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L1454)
- [`window_customize_set_command_callback`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_set_command_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L1219)
- [`window_customize_set_note_callback`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_set_note_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L1248)
- [`window_customize_set_option_callback`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_set_option_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L1016)
- [`window_tree_command_done`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_command_done/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L1061)
- [`window_tree_init`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L944)
- [`window_tree_key`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L1276)
- [`window_tree_update`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_update/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L997)

## Calls

- [`mode_tree_build_lines`](/en/tmux/3.7c/reference/c-function-mode-tree-c-mode_tree_build_lines/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L610)
- [`mode_tree_check_selected`](/en/tmux/3.7c/reference/c-function-mode-tree-c-mode_tree_check_selected/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L621)
- [`mode_tree_clear_lines`](/en/tmux/3.7c/reference/c-function-mode-tree-c-mode_tree_clear_lines/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L608)
- [`mode_tree_free_items`](/en/tmux/3.7c/reference/c-function-mode-tree-c-mode_tree_free_items/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L605)
- [`mode_tree_set_current`](/en/tmux/3.7c/reference/c-function-mode_tree_set_current/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L614)
- [`mode_tree_set_height`](/en/tmux/3.7c/reference/c-function-mode-tree-c-mode_tree_set_height/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L618)

## Referenced declarations

- [`mode_tree_data.buildcb`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-buildcb/) (attribute)
- [`mode_tree_data.children`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-children/) (attribute)
- [`mode_tree_data.current`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-current/) (attribute)
- [`mode_tree_data.filter`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-filter/) (attribute)
- [`mode_tree_data.height`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-height/) (attribute)
- [`mode_tree_line.item`](/en/tmux/3.7c/reference/c-struct-mode_tree_line-item/) (attribute)
- [`mode_tree_data.line_list`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-line_list/) (attribute)
- [`mode_tree_data.maxdepth`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-maxdepth/) (attribute)
- [`mode_tree_data`](/en/tmux/3.7c/reference/c-struct-mode_tree_data/) (struct)
- [`MODE_TREE_PREVIEW_OFF`](/en/tmux/3.7c/reference/c-enum-mode_tree_preview-mode_tree_preview_off/) (constant)
- [`mode_tree_data.modedata`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-modedata/) (attribute)
- [`mode_tree_data.no_matches`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-no_matches/) (attribute)
- [`mode_tree_data.preview`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-preview/) (attribute)
- [`mode_tree_data.saved`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-saved/) (attribute)
- [`mode_tree_data.screen`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-screen/) (attribute)
- [`screen_size_x`](/en/tmux/3.7c/reference/c-define-tmux-h-screen_size_x/) (constant)
- [`screen_size_y`](/en/tmux/3.7c/reference/c-define-tmux-h-screen_size_y/) (constant)
- [`mode_tree_data.sort_crit`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-sort_crit/) (attribute)
- [`mode_tree_data.sortcb`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-sortcb/) (attribute)
- [`mode_tree_item.tag`](/en/tmux/3.7c/reference/c-struct-mode_tree_item-tag/) (attribute)
- [`mode_tree_data.width`](/en/tmux/3.7c/reference/c-struct-mode_tree_data-width/) (attribute)
