# lv_win.h (/api/public/widgets/lv_win_h)



<RelatedHeaders name="lv_win_private.h" isPrivate="false" />

<ApiSummary functions="5" macros="1" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (2)&#x22;,&#x22;Other (3)&#x22;]">
  <ApiTab value="Getters (2)">
    <ApiMember kind="function" name="lv_win_get_header" file="public/widgets/lv_win.h" line="76" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_win.h#L76">
      lv_win_get_header [#lv_win_get_header]

      Get the header of the window

      \> &#x2A;*Deprecated:** The `lv_win` widget is deprecated. See `lv_example_flex_win`.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_win_get_header(lv_obj_t *win)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                |
      | ----- | ------------------------------------------------ | -------------------------- |
      | `win` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a window widget |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the header of the window
    </ApiMember>

    <ApiMember kind="function" name="lv_win_get_content" file="public/widgets/lv_win.h" line="85" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_win.h#L85">
      lv_win_get_content [#lv_win_get_content]

      Get the content of the window

      \> &#x2A;*Deprecated:** The `lv_win` widget is deprecated. See `lv_example_flex_win`.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_win_get_content(lv_obj_t *win)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                |
      | ----- | ------------------------------------------------ | -------------------------- |
      | `win` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a window widget |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the content of the window
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (3)">
    <ApiMember kind="function" name="lv_win_create" file="public/widgets/lv_win.h" line="46" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_win.h#L46">
      lv_win_create [#lv_win_create]

      Create a window widget

      \> &#x2A;*Deprecated:** Use a flex column with a header and content area instead. See `lv_example_flex_win`.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_win_create(lv_obj_t *parent)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                                                                                         |
      | -------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a parent widget **May** be `NULL`.. When NULL, the widget is created as a screen on the default display. |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the created window
    </ApiMember>

    <ApiMember kind="function" name="lv_win_add_title" file="public/widgets/lv_win.h" line="56" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_win.h#L56">
      lv_win_add_title [#lv_win_add_title]

      Add a title to the window

      \> &#x2A;*Deprecated:** The `lv_win` widget is deprecated. See `lv_example_flex_win`.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_win_add_title(lv_obj_t *win, const char *txt)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                |
      | ----- | ------------------------------------------------ | -------------------------- |
      | `win` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a window widget |
      | `txt` | `const char *`                                   | the text of the title      |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the widget where the content of the title can be created
    </ApiMember>

    <ApiMember kind="function" name="lv_win_add_button" file="public/widgets/lv_win.h" line="67" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_win.h#L67">
      lv_win_add_button [#lv_win_add_button]

      Add a button to the window

      \> &#x2A;*Deprecated:** The `lv_win` widget is deprecated. See `lv_example_flex_win`.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_win_add_button(lv_obj_t *win, const void *icon, int32_t btn_w)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                                              |
      | ------- | ------------------------------------------------ | -------------------------------------------------------- |
      | `win`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a window widget                               |
      | `icon`  | `const void *`                                   | an icon to be displayed on the button **May** be `NULL`. |
      | `btn_w` | `int32_t`                                        | width of the button                                      |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the widget where the content of the button can be created
    </ApiMember>
  </ApiTab>
</ApiTabs>

Macros [#macros]

<ApiMember kind="macro" name="LV_WIN_DEPRECATED_MSG" file="public/widgets/lv_win.h" line="29" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_win.h#L29">
  LV_WIN_DEPRECATED_MSG [#lv_win_deprecated_msg]

  ```c title=" " lineNumbers=1
  #define LV_WIN_DEPRECATED_MSG "lv_win is deprecated; build a window from a flex column instead. See the lv_example_flex_win example."
  ```

  \> &#x2A;*Deprecated:** The `lv_win` widget is deprecated and kept only for backward compatibility. A window is just a flex column with a header bar and a content area, so build one directly from `lv_obj` instead. See the `lv_example_flex_win` example for a starting point.
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_win_class" file="public/widgets/lv_win.h" line="32" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_win.h#L32">
  lv_win_class [#lv_win_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_win_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_obj.h&#x22;]" includedBy="[&#x22;lvgl.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_property.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
