# mode_tree_start

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

```c
struct mode_tree_data * mode_tree_start(struct window_pane *wp, struct args *args, mode_tree_build_cb buildcb, mode_tree_draw_cb drawcb, mode_tree_search_cb searchcb, mode_tree_menu_cb menucb, mode_tree_height_cb heightcb, mode_tree_key_cb keycb, mode_tree_swap_cb swapcb, mode_tree_sort_cb sortcb, mode_tree_help_cb helpcb, void *modedata, const struct menu_item *menu, struct screen **s)
```

## Parameters

- `wp` (`struct window_pane *`)
- `args` (`struct args *`)
- `buildcb` (`mode_tree_build_cb`)
- `drawcb` (`mode_tree_draw_cb`)
- `searchcb` (`mode_tree_search_cb`)
- `menucb` (`mode_tree_menu_cb`)
- `heightcb` (`mode_tree_height_cb`)
- `keycb` (`mode_tree_key_cb`)
- `swapcb` (`mode_tree_swap_cb`)
- `sortcb` (`mode_tree_sort_cb`)
- `helpcb` (`mode_tree_help_cb`)
- `modedata` (`void *`)
- `menu` (`const struct menu_item *`)
- `s` (`struct screen **`)

## Called by

- [`window_buffer_init`](/en/tmux/latest/reference/c-function-window-buffer-c-window_buffer_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-buffer.c#L376)
- [`window_client_init`](/en/tmux/latest/reference/c-function-window-client-c-window_client_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L287)
- [`window_customize_init`](/en/tmux/latest/reference/c-function-window-customize-c-window_customize_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L913)
- [`window_tree_init`](/en/tmux/latest/reference/c-function-window-tree-c-window_tree_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L938)

## Calls

- [`args_has`](/en/tmux/latest/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L507)
- [`sort_order_from_string`](/en/tmux/latest/reference/c-function-sort_order_from_string/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L514)
- [`xcalloc`](/en/tmux/latest/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L500)
- [`xstrdup`](/en/tmux/latest/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L518)

## Other function references

- [`args_get`](/en/tmux/latest/reference/c-function-args_get/) (function)
- [`screen_init`](/en/tmux/latest/reference/c-function-screen_init/) (function)

## Referenced declarations

- [`args`](/en/tmux/latest/reference/c-struct-args/) (struct)
- [`window_pane.base`](/en/tmux/latest/reference/c-struct-window_pane-base/) (attribute)
- [`mode_tree_data.buildcb`](/en/tmux/latest/reference/c-struct-mode_tree_data-buildcb/) (attribute)
- [`mode_tree_data.children`](/en/tmux/latest/reference/c-struct-mode_tree_data-children/) (attribute)
- [`mode_tree_data.drawcb`](/en/tmux/latest/reference/c-struct-mode_tree_data-drawcb/) (attribute)
- [`mode_tree_data.filter`](/en/tmux/latest/reference/c-struct-mode_tree_data-filter/) (attribute)
- [`mode_tree_data.heightcb`](/en/tmux/latest/reference/c-struct-mode_tree_data-heightcb/) (attribute)
- [`mode_tree_data.helpcb`](/en/tmux/latest/reference/c-struct-mode_tree_data-helpcb/) (attribute)
- [`mode_tree_data.keycb`](/en/tmux/latest/reference/c-struct-mode_tree_data-keycb/) (attribute)
- [`mode_tree_data.menu`](/en/tmux/latest/reference/c-struct-mode_tree_data-menu/) (attribute)
- [`menu_item`](/en/tmux/latest/reference/c-struct-menu_item/) (struct)
- [`mode_tree_data.menucb`](/en/tmux/latest/reference/c-struct-mode_tree_data-menucb/) (attribute)
- [`MODE_CURSOR`](/en/tmux/latest/reference/c-define-tmux-h-mode_cursor/) (constant)
- [`mode_tree_build_cb`](/en/tmux/latest/reference/c-typedef-mode_tree_build_cb/) (typealias)
- [`mode_tree_data`](/en/tmux/latest/reference/c-struct-mode_tree_data/) (struct)
- [`mode_tree_draw_cb`](/en/tmux/latest/reference/c-typedef-mode_tree_draw_cb/) (typealias)
- [`mode_tree_height_cb`](/en/tmux/latest/reference/c-typedef-mode_tree_height_cb/) (typealias)
- [`mode_tree_help_cb`](/en/tmux/latest/reference/c-typedef-mode_tree_help_cb/) (typealias)
- [`mode_tree_key_cb`](/en/tmux/latest/reference/c-typedef-mode_tree_key_cb/) (typealias)
- [`mode_tree_menu_cb`](/en/tmux/latest/reference/c-typedef-mode_tree_menu_cb/) (typealias)
- [`MODE_TREE_PREVIEW_BIG`](/en/tmux/latest/reference/c-enum-mode_tree_preview-mode_tree_preview_big/) (constant)
- [`MODE_TREE_PREVIEW_NORMAL`](/en/tmux/latest/reference/c-enum-mode_tree_preview-mode_tree_preview_normal/) (constant)
- [`MODE_TREE_PREVIEW_OFF`](/en/tmux/latest/reference/c-enum-mode_tree_preview-mode_tree_preview_off/) (constant)
- [`mode_tree_search_cb`](/en/tmux/latest/reference/c-typedef-mode_tree_search_cb/) (typealias)
- [`mode_tree_sort_cb`](/en/tmux/latest/reference/c-typedef-mode_tree_sort_cb/) (typealias)
- [`mode_tree_swap_cb`](/en/tmux/latest/reference/c-typedef-mode_tree_swap_cb/) (typealias)
- [`mode_tree_data.modedata`](/en/tmux/latest/reference/c-struct-mode_tree_data-modedata/) (attribute)
- [`sort_criteria.order`](/en/tmux/latest/reference/c-struct-sort_criteria-order/) (attribute)
- [`mode_tree_data.preview`](/en/tmux/latest/reference/c-struct-mode_tree_data-preview/) (attribute)
- [`mode_tree_data.references`](/en/tmux/latest/reference/c-struct-mode_tree_data-references/) (attribute)
- [`sort_criteria.reversed`](/en/tmux/latest/reference/c-struct-sort_criteria-reversed/) (attribute)
- [`mode_tree_data.screen`](/en/tmux/latest/reference/c-struct-mode_tree_data-screen/) (attribute)
- [`screen`](/en/tmux/latest/reference/c-struct-screen/) (struct)
- [`screen_size_x`](/en/tmux/latest/reference/c-define-tmux-h-screen_size_x/) (constant)
- [`screen_size_y`](/en/tmux/latest/reference/c-define-tmux-h-screen_size_y/) (constant)
- [`mode_tree_data.searchcb`](/en/tmux/latest/reference/c-struct-mode_tree_data-searchcb/) (attribute)
- [`mode_tree_data.sort_crit`](/en/tmux/latest/reference/c-struct-mode_tree_data-sort_crit/) (attribute)
- [`mode_tree_data.sortcb`](/en/tmux/latest/reference/c-struct-mode_tree_data-sortcb/) (attribute)
- [`mode_tree_data.swapcb`](/en/tmux/latest/reference/c-struct-mode_tree_data-swapcb/) (attribute)
- [`window_pane`](/en/tmux/latest/reference/c-struct-window_pane/) (struct)
- [`mode_tree_data.wp`](/en/tmux/latest/reference/c-struct-mode_tree_data-wp/) (attribute)
