# window_tree_build_window

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

```c
static int window_tree_build_window(struct session *s, struct winlink *wl, void *modedata, struct sort_criteria *sort_crit, struct mode_tree_item *parent, const char *filter)
```

## Parameters

- `s` (`struct session *`)
- `wl` (`struct winlink *`)
- `modedata` (`void *`)
- `sort_crit` (`struct sort_criteria *`)
- `parent` (`struct mode_tree_item *`)
- `filter` (`const char *`)

## Called by

- [`window_tree_build_session`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_build_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L339)

## Calls

- [`format_defaults`](/en/tmux/3.7c/reference/c-function-format_defaults/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L265)
- [`format_expand`](/en/tmux/3.7c/reference/c-function-format_expand/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L266)
- [`format_free`](/en/tmux/3.7c/reference/c-function-format_free/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L268)
- [`mode_tree_add`](/en/tmux/3.7c/reference/c-function-mode_tree_add/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L275)
- [`mode_tree_align`](/en/tmux/3.7c/reference/c-function-mode_tree_align/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L279)
- [`mode_tree_remove`](/en/tmux/3.7c/reference/c-function-mode_tree_remove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L300)
- [`sort_get_panes_window`](/en/tmux/3.7c/reference/c-function-sort_get_panes_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L288)
- [`window_tree_add_item`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_add_item/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L258)
- [`window_tree_build_pane`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_build_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L293)
- [`window_tree_filter_pane`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_filter_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L284)
- [`window_tree_free_item`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_free_item/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L298)
- [`xasprintf`](/en/tmux/3.7c/reference/c-function-xasprintf/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L267)

## Other function references

- [`format_create`](/en/tmux/3.7c/reference/c-function-format_create/) (function)

## Referenced declarations

- [`window.active`](/en/tmux/3.7c/reference/c-struct-window-active/) (attribute)
- [`window_tree_modedata.data`](/en/tmux/3.7c/reference/c-struct-window_tree_modedata-data/) (attribute)
- [`window_tree_modedata.format`](/en/tmux/3.7c/reference/c-struct-window_tree_modedata-format/) (attribute)
- [`FORMAT_PANE`](/en/tmux/3.7c/reference/c-define-tmux-h-format_pane/) (constant)
- [`session.id`](/en/tmux/3.7c/reference/c-struct-session-id/) (attribute)
- [`window_pane.id`](/en/tmux/3.7c/reference/c-struct-window_pane-id/) (attribute)
- [`winlink.idx`](/en/tmux/3.7c/reference/c-struct-winlink-idx/) (attribute)
- [`format_tree.item`](/en/tmux/3.7c/reference/c-struct-format_tree-item/) (attribute)
- [`window_tree_modedata.item_size`](/en/tmux/3.7c/reference/c-struct-window_tree_modedata-item_size/) (attribute)
- [`mode_tree_item`](/en/tmux/3.7c/reference/c-struct-mode_tree_item/) (struct)
- [`mode_tree_item.name`](/en/tmux/3.7c/reference/c-struct-mode_tree_item-name/) (attribute)
- [`window.panes`](/en/tmux/3.7c/reference/c-struct-window-panes/) (attribute)
- [`format_tree.s`](/en/tmux/3.7c/reference/c-struct-format_tree-s/) (attribute)
- [`session`](/en/tmux/3.7c/reference/c-struct-session/) (struct)
- [`sort_criteria`](/en/tmux/3.7c/reference/c-struct-sort_criteria/) (struct)
- [`mode_tree_item.text`](/en/tmux/3.7c/reference/c-struct-mode_tree_item-text/) (attribute)
- [`cmdq_item.type`](/en/tmux/3.7c/reference/c-struct-cmdq_item-type/) (attribute)
- [`window_tree_modedata.type`](/en/tmux/3.7c/reference/c-struct-window_tree_modedata-type/) (attribute)
- [`winlink.window`](/en/tmux/3.7c/reference/c-struct-winlink-window/) (attribute)
- [`WINDOW_TREE_SESSION`](/en/tmux/3.7c/reference/c-enum-window_tree_type-window_tree_session/) (constant)
- [`WINDOW_TREE_WINDOW`](/en/tmux/3.7c/reference/c-enum-window_tree_type-window_tree_window/) (constant)
- [`winlink`](/en/tmux/3.7c/reference/c-struct-winlink/) (struct)
- [`format_tree.wl`](/en/tmux/3.7c/reference/c-struct-format_tree-wl/) (attribute)
- [`format_tree.wp`](/en/tmux/3.7c/reference/c-struct-format_tree-wp/) (attribute)
