# lv_msgbox.h (/api/widgets/msgbox/lv_msgbox_h)



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

<ApiSummary functions="13" variables="7" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (4)&#x22;,&#x22;Other (9)&#x22;]">
  <ApiTab value="Getters (4)">
    <ApiMember kind="function" name="lv_msgbox_get_header" file="widgets/msgbox/lv_msgbox.h" line="95" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L95">
      lv_msgbox_get_header [#lv_msgbox_get_header]

      Get the header widget

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_msgbox_get_header(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description              |
      | ----- | ------------------------------------------------ | ------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the header, or NULL if not exists
    </ApiMember>

    <ApiMember kind="function" name="lv_msgbox_get_footer" file="widgets/msgbox/lv_msgbox.h" line="102" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L102">
      lv_msgbox_get_footer [#lv_msgbox_get_footer]

      Get the footer widget

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_msgbox_get_footer(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description              |
      | ----- | ------------------------------------------------ | ------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the footer, or NULL if not exists
    </ApiMember>

    <ApiMember kind="function" name="lv_msgbox_get_content" file="widgets/msgbox/lv_msgbox.h" line="109" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L109">
      lv_msgbox_get_content [#lv_msgbox_get_content]

      Get the content widget

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_msgbox_get_content(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description              |
      | ----- | ------------------------------------------------ | ------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |

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

    <ApiMember kind="function" name="lv_msgbox_get_title" file="widgets/msgbox/lv_msgbox.h" line="116" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L116">
      lv_msgbox_get_title [#lv_msgbox_get_title]

      Get the title label

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_msgbox_get_title(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description              |
      | ----- | ------------------------------------------------ | ------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the title, or NULL if it does not exist
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (9)">
    <ApiMember kind="function" name="lv_msgbox_create" file="widgets/msgbox/lv_msgbox.h" line="41" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L41">
      lv_msgbox_create [#lv_msgbox_create]

      Create an empty message box

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

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

      | Name     | Type                                             | Description                                 |
      | -------- | ------------------------------------------------ | ------------------------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | the parent or NULL to create a modal msgbox |

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

    <ApiMember kind="function" name="lv_msgbox_add_title" file="widgets/msgbox/lv_msgbox.h" line="49" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L49">
      lv_msgbox_add_title [#lv_msgbox_add_title]

      Add title to the message box. It also creates a header for the title.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_msgbox_add_title(lv_obj_t *obj, const char *title)
      ```

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

      | Name    | Type                                             | Description              |
      | ------- | ------------------------------------------------ | ------------------------ |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |
      | `title` | `const char *`                                   | the text of the tile     |

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

    <ApiMember kind="function" name="lv_msgbox_add_header_button" file="widgets/msgbox/lv_msgbox.h" line="57" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L57">
      lv_msgbox_add_header_button [#lv_msgbox_add_header_button]

      Add a button to the header of to the message box. It also creates a header.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_msgbox_add_header_button(lv_obj_t *obj, const void *icon)
      ```

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

      | Name   | Type                                             | Description              |
      | ------ | ------------------------------------------------ | ------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |
      | `icon` | `const void *`                                   | the icon of the button   |

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

    <ApiMember kind="function" name="lv_msgbox_add_text" file="widgets/msgbox/lv_msgbox.h" line="65" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L65">
      lv_msgbox_add_text [#lv_msgbox_add_text]

      Add a text to the content area of message box. Multiple texts will be created below each other.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_msgbox_add_text(lv_obj_t *obj, const char *text)
      ```

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

      | Name   | Type                                             | Description              |
      | ------ | ------------------------------------------------ | ------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |
      | `text` | `const char *`                                   | text to add              |

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

    <ApiMember kind="function" name="lv_msgbox_add_text_fmt" file="widgets/msgbox/lv_msgbox.h" line="73" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L73">
      lv_msgbox_add_text_fmt [#lv_msgbox_add_text_fmt]

      Add a formatted text to the content area of message box. Multiple texts will be created below each other.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_msgbox_add_text_fmt(lv_obj_t *obj, const char *fmt,...)
      ```

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

      | Name  | Type                                             | Description                 |
      | ----- | ------------------------------------------------ | --------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box    |
      | `fmt` | `const char *`                                   | `printf`-like format string |
      | `...` |                                                  |                             |

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

    <ApiMember kind="function" name="lv_msgbox_add_footer_button" file="widgets/msgbox/lv_msgbox.h" line="81" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L81">
      lv_msgbox_add_footer_button [#lv_msgbox_add_footer_button]

      Add a button to the footer of to the message box. It also creates a footer.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_msgbox_add_footer_button(lv_obj_t *obj, const char *text)
      ```

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

      | Name   | Type                                             | Description              |
      | ------ | ------------------------------------------------ | ------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |
      | `text` | `const char *`                                   | the text of the button   |

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

    <ApiMember kind="function" name="lv_msgbox_add_close_button" file="widgets/msgbox/lv_msgbox.h" line="88" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L88">
      lv_msgbox_add_close_button [#lv_msgbox_add_close_button]

      Add a close button to the message box. It also creates a header.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_msgbox_add_close_button(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description              |
      | ----- | ------------------------------------------------ | ------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |

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

    <ApiMember kind="function" name="lv_msgbox_close" file="widgets/msgbox/lv_msgbox.h" line="122" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L122">
      lv_msgbox_close [#lv_msgbox_close]

      Close a message box

      ```c title=" " lineNumbers=1
      void lv_msgbox_close(lv_obj_t *mbox)
      ```

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

      | Name   | Type                                             | Description              |
      | ------ | ------------------------------------------------ | ------------------------ |
      | `mbox` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |
    </ApiMember>

    <ApiMember kind="function" name="lv_msgbox_close_async" file="widgets/msgbox/lv_msgbox.h" line="128" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L128">
      lv_msgbox_close_async [#lv_msgbox_close_async]

      Close a message box in the next call of the message box

      ```c title=" " lineNumbers=1
      void lv_msgbox_close_async(lv_obj_t *mbox)
      ```

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

      | Name   | Type                                             | Description              |
      | ------ | ------------------------------------------------ | ------------------------ |
      | `mbox` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a message box |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Variables [#variables]

<ApiMember kind="variable" name="lv_msgbox_class" file="widgets/msgbox/lv_msgbox.h" line="24" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L24">
  lv_msgbox_class [#lv_msgbox_class]

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

<ApiMember kind="variable" name="lv_msgbox_header_class" file="widgets/msgbox/lv_msgbox.h" line="25" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L25">
  lv_msgbox_header_class [#lv_msgbox_header_class]

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

<ApiMember kind="variable" name="lv_msgbox_content_class" file="widgets/msgbox/lv_msgbox.h" line="26" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L26">
  lv_msgbox_content_class [#lv_msgbox_content_class]

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

<ApiMember kind="variable" name="lv_msgbox_footer_class" file="widgets/msgbox/lv_msgbox.h" line="27" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L27">
  lv_msgbox_footer_class [#lv_msgbox_footer_class]

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

<ApiMember kind="variable" name="lv_msgbox_header_button_class" file="widgets/msgbox/lv_msgbox.h" line="28" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L28">
  lv_msgbox_header_button_class [#lv_msgbox_header_button_class]

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

<ApiMember kind="variable" name="lv_msgbox_footer_button_class" file="widgets/msgbox/lv_msgbox.h" line="29" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L29">
  lv_msgbox_footer_button_class [#lv_msgbox_footer_button_class]

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

<ApiMember kind="variable" name="lv_msgbox_backdrop_class" file="widgets/msgbox/lv_msgbox.h" line="30" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/msgbox/lv_msgbox.h#L30">
  lv_msgbox_backdrop_class [#lv_msgbox_backdrop_class]

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

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_obj.h&#x22;]" includedBy="[&#x22;lv_msgbox_private.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.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_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.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_ll.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_property_names.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_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
