# mode_tree_draw

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L616
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-mode_tree_draw/

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

## Parameters

- `mtd` (`struct mode_tree_data *`)

## Called by

- [`mode_tree_filter_callback`](/en/tmux/3.2a/reference/c-function-mode-tree-c-mode_tree_filter_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L896)
- [`mode_tree_resize`](/en/tmux/3.2a/reference/c-function-mode_tree_resize/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L547)
- [`mode_tree_search_set`](/en/tmux/3.2a/reference/c-function-mode-tree-c-mode_tree_search_set/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L849)
- [`window_buffer_edit_close_cb`](/en/tmux/3.2a/reference/c-function-window-buffer-c-window_buffer_edit_close_cb/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-buffer.c#L471)
- [`window_buffer_init`](/en/tmux/3.2a/reference/c-function-window-buffer-c-window_buffer_init/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-buffer.c#L358)
- [`window_buffer_key`](/en/tmux/3.2a/reference/c-function-window-buffer-c-window_buffer_key/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-buffer.c#L540)
- [`window_buffer_update`](/en/tmux/3.2a/reference/c-function-window-buffer-c-window_buffer_update/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-buffer.c#L399)
- [`window_client_init`](/en/tmux/3.2a/reference/c-function-window-client-c-window_client_init/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-client.c#L318)
- [`window_client_key`](/en/tmux/3.2a/reference/c-function-window-client-c-window_client_key/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-client.c#L415)
- [`window_client_update`](/en/tmux/3.2a/reference/c-function-window-client-c-window_client_update/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-client.c#L359)
- [`window_customize_change_current_callback`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_change_current_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L1381)
- [`window_customize_change_tagged_callback`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_change_tagged_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L1401)
- [`window_customize_init`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_init/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L898)
- [`window_customize_key`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_key/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L1514)
- [`window_customize_set_command_callback`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_set_command_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L1201)
- [`window_customize_set_note_callback`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_set_note_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L1230)
- [`window_customize_set_option_callback`](/en/tmux/3.2a/reference/c-function-window-customize-c-window_customize_set_option_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-customize.c#L995)
- [`window_tree_command_done`](/en/tmux/3.2a/reference/c-function-window-tree-c-window_tree_command_done/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L1058)
- [`window_tree_init`](/en/tmux/3.2a/reference/c-function-window-tree-c-window_tree_init/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L941)
- [`window_tree_key`](/en/tmux/3.2a/reference/c-function-window-tree-c-window_tree_key/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L1336)
- [`window_tree_update`](/en/tmux/3.2a/reference/c-function-window-tree-c-window_tree_update/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-tree.c#L994)

## Calls

- [`format_draw`](/en/tmux/3.2a/reference/c-function-format_draw/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L718)
- [`screen_write_box`](/en/tmux/3.2a/reference/c-function-screen_write_box/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L750)
- [`screen_write_clearendofline`](/en/tmux/3.2a/reference/c-function-screen_write_clearendofline/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L715)
- [`screen_write_clearscreen`](/en/tmux/3.2a/reference/c-function-screen_write_clearscreen/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L642)
- [`screen_write_cursormove`](/en/tmux/3.2a/reference/c-function-screen_write_cursormove/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L661)
- [`screen_write_nputs`](/en/tmux/3.2a/reference/c-function-screen_write_nputs/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L716)
- [`screen_write_puts`](/en/tmux/3.2a/reference/c-function-screen_write_puts/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L760)
- [`screen_write_start`](/en/tmux/3.2a/reference/c-function-screen_write_start/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L641)
- [`screen_write_stop`](/en/tmux/3.2a/reference/c-function-screen_write_stop/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L740)
- [`style_apply`](/en/tmux/3.2a/reference/c-function-style_apply/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L636)
- [`utf8_cstrwidth`](/en/tmux/3.2a/reference/c-function-utf8_cstrwidth/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L704)
- [`xasprintf`](/en/tmux/3.2a/reference/c-function-xasprintf/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L665)
- [`xcalloc`](/en/tmux/3.2a/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L683)
- [`xstrdup`](/en/tmux/3.2a/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L667)

## Referenced declarations

- [`grid_cell.attr`](/en/tmux/3.2a/reference/c-struct-grid_cell-attr/) (attribute)
- [`grid_cell.bg`](/en/tmux/3.2a/reference/c-struct-grid_cell-bg/) (attribute)
- [`mode_tree_item.children`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-children/) (attribute)
- [`mode_tree_data.current`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-current/) (attribute)
- [`mode_tree_line.depth`](/en/tmux/3.2a/reference/c-struct-mode_tree_line-depth/) (attribute)
- [`mode_tree_item.draw_as_parent`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-draw_as_parent/) (attribute)
- [`mode_tree_data.drawcb`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-drawcb/) (attribute)
- [`mode_tree_item.expanded`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-expanded/) (attribute)
- [`mode_tree_sort_criteria.field`](/en/tmux/3.2a/reference/c-struct-mode_tree_sort_criteria-field/) (attribute)
- [`mode_tree_data.filter`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-filter/) (attribute)
- [`mode_tree_line.flat`](/en/tmux/3.2a/reference/c-struct-mode_tree_line-flat/) (attribute)
- [`GRID_ATTR_BRIGHT`](/en/tmux/3.2a/reference/c-define-tmux-h-grid_attr_bright/) (constant)
- [`grid_default_cell`](/en/tmux/3.2a/reference/c-variable-grid_default_cell/) (attribute)
- [`mode_tree_data.height`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-height/) (attribute)
- [`mode_tree_line.item`](/en/tmux/3.2a/reference/c-struct-mode_tree_line-item/) (attribute)
- [`mode_tree_item.itemdata`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-itemdata/) (attribute)
- [`mode_tree_item.key`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-key/) (attribute)
- [`KEYC_NONE`](/en/tmux/3.2a/reference/c-define-tmux-h-keyc_none/) (constant)
- [`mode_tree_item.keylen`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-keylen/) (attribute)
- [`mode_tree_item.keystr`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-keystr/) (attribute)
- [`mode_tree_line.last`](/en/tmux/3.2a/reference/c-struct-mode_tree_line-last/) (attribute)
- [`mode_tree_item.line`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-line/) (attribute)
- [`mode_tree_data.line_list`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-line_list/) (attribute)
- [`mode_tree_data.line_size`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-line_size/) (attribute)
- [`mode_tree_data`](/en/tmux/3.2a/reference/c-struct-mode_tree_data/) (struct)
- [`mode_tree_data.modedata`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-modedata/) (attribute)
- [`mode_tree_item.name`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-name/) (attribute)
- [`mode_tree_data.no_matches`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-no_matches/) (attribute)
- [`mode_tree_data.offset`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-offset/) (attribute)
- [`window.options`](/en/tmux/3.2a/reference/c-struct-window-options/) (attribute)
- [`mode_tree_item.parent`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-parent/) (attribute)
- [`mode_tree_data.preview`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-preview/) (attribute)
- [`mode_tree_sort_criteria.reversed`](/en/tmux/3.2a/reference/c-struct-mode_tree_sort_criteria-reversed/) (attribute)
- [`mode_tree_data.screen`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-screen/) (attribute)
- [`screen_size_y`](/en/tmux/3.2a/reference/c-define-tmux-h-screen_size_y/) (constant)
- [`mode_tree_data.sort_crit`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-sort_crit/) (attribute)
- [`mode_tree_data.sort_list`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-sort_list/) (attribute)
- [`mode_tree_item.tagged`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-tagged/) (attribute)
- [`mode_tree_item.text`](/en/tmux/3.2a/reference/c-struct-mode_tree_item-text/) (attribute)
- [`mode_tree_data.width`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-width/) (attribute)
- [`window_pane.window`](/en/tmux/3.2a/reference/c-struct-window_pane-window/) (attribute)
- [`mode_tree_data.wp`](/en/tmux/3.2a/reference/c-struct-mode_tree_data-wp/) (attribute)
