lv_menu.h
API reference for lv_menu.h
Functions
lv_menu_set_page
Set menu page to display in main
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
void lv_menu_set_page(lv_obj_t *obj, lv_obj_t *page)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to the menu |
page | lv_obj_t * | pointer to the menu page to set. May be NULL. When NULL main is cleared along with the menu history. |
lv_menu_set_page_title
Set menu page title
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
void lv_menu_set_page_title(lv_obj_t *page_obj, char const *const title)| Name | Type | Description |
|---|---|---|
page_obj | lv_obj_t * | pointer to the menu page |
title | char const *const | pointer to text for title in header. May be NULL. When NULL no title is displayed. |
lv_menu_set_page_title_static
Set menu page title with a static text. It will not be saved by the label so the 'text' variable has to be 'alive' while the page exists.
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
void lv_menu_set_page_title_static(lv_obj_t *page_obj, char const *const title)| Name | Type | Description |
|---|---|---|
page_obj | lv_obj_t * | pointer to the menu page |
title | char const *const | pointer to text for title in header. May be NULL. When NULL no title is displayed. |
lv_menu_set_sidebar_page
Set menu page to display in sidebar
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
void lv_menu_set_sidebar_page(lv_obj_t *obj, lv_obj_t *page)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to the menu |
page | lv_obj_t * | pointer to the menu page to set. May be NULL. When NULL the sidebar is cleared. |
lv_menu_set_mode_header
Set the how the header should behave and its position
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
void lv_menu_set_mode_header(lv_obj_t *obj, lv_menu_mode_header_t mode)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a menu |
mode | lv_menu_mode_header_t | LV_MENU_HEADER_TOP_FIXED/TOP_UNFIXED/BOTTOM_FIXED |
lv_menu_set_mode_root_back_button
Set whether back button should appear at root
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
void lv_menu_set_mode_root_back_button(lv_obj_t *obj, lv_menu_mode_root_back_button_t mode)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a menu |
mode | lv_menu_mode_root_back_button_t | LV_MENU_ROOT_BACK_BUTTON_DISABLED/ENABLED |
lv_menu_set_load_page_event
Add menu to the menu item
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
void lv_menu_set_load_page_event(lv_obj_t *menu, lv_obj_t *obj, lv_obj_t *page)| Name | Type | Description |
|---|---|---|
menu | lv_obj_t * | pointer to the menu |
obj | lv_obj_t * | pointer to the obj |
page | lv_obj_t * | pointer to the page to load when obj is clicked |
lv_menu_get_cur_main_page
Get a pointer to menu page that is currently displayed in main
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_obj_t * lv_menu_get_cur_main_page(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to the menu |
Returns: lv_obj_t * — pointer to current page
lv_menu_get_cur_sidebar_page
Get a pointer to menu page that is currently displayed in sidebar
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_obj_t * lv_menu_get_cur_sidebar_page(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to the menu |
Returns: lv_obj_t * — pointer to current page
lv_menu_get_main_header
Get a pointer to main header obj
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_obj_t * lv_menu_get_main_header(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to the menu |
Returns: lv_obj_t * — pointer to main header obj
lv_menu_get_main_header_back_button
Get a pointer to main header back btn obj
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_obj_t * lv_menu_get_main_header_back_button(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to the menu |
Returns: lv_obj_t * — pointer to main header back btn obj
lv_menu_get_sidebar_header
Get a pointer to sidebar header obj
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_obj_t * lv_menu_get_sidebar_header(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to the menu |
Returns: lv_obj_t * — pointer to sidebar header obj
lv_menu_get_sidebar_header_back_button
Get a pointer to sidebar header obj
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_obj_t * lv_menu_get_sidebar_header_back_button(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to the menu |
Returns: lv_obj_t * — pointer to sidebar header back btn obj
lv_menu_get_mode_header
Get the header mode of the menu
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_menu_mode_header_t lv_menu_get_mode_header(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a menu |
Returns: lv_menu_mode_header_t — LV_MENU_HEADER_TOP_FIXED/TOP_UNFIXED/BOTTOM_FIXED
lv_menu_get_mode_root_back_button
Get the root back button mode of the menu
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_menu_mode_root_back_button_t lv_menu_get_mode_root_back_button(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a menu |
Returns: lv_menu_mode_root_back_button_t — LV_MENU_ROOT_BACK_BUTTON_DISABLED/ENABLED
lv_menu_create
Create a menu object
> Deprecated: The lv_menu widget is deprecated. Build menu navigation from base widgets instead. See lv_example_menu_navigation.
lv_obj_t * lv_menu_create(lv_obj_t *parent)| Name | Type | Description |
|---|---|---|
parent | 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: lv_obj_t * — pointer to the created menu
lv_menu_page_create
Create a menu page object.
This call inserts the new page under menu->storage as its parent, which is itself a child of the menu, so the resulting object hierarchy is: menu => storage => new_page where storage is a Base Widget.
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_obj_t * lv_menu_page_create(lv_obj_t *menu, char const *const title)| Name | Type | Description |
|---|---|---|
menu | lv_obj_t * | pointer to menu object. |
title | char const *const | pointer to text for title in header. May be NULL. When NULL no title is displayed. |
Returns: lv_obj_t * — pointer to the created menu page
lv_menu_cont_create
Create a menu cont object
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_obj_t * lv_menu_cont_create(lv_obj_t *parent)| Name | Type | Description |
|---|---|---|
parent | lv_obj_t * | pointer to a menu page or menu section object, it will be the parent of the new menu cont object |
Returns: lv_obj_t * — pointer to the created menu cont
lv_menu_section_create
Create a menu section object
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_obj_t * lv_menu_section_create(lv_obj_t *parent)| Name | Type | Description |
|---|---|---|
parent | lv_obj_t * | pointer to a menu page object, it will be the parent of the new menu section object |
Returns: lv_obj_t * — pointer to the created menu section
lv_menu_separator_create
Create a menu separator object
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
lv_obj_t * lv_menu_separator_create(lv_obj_t *parent)| Name | Type | Description |
|---|---|---|
parent | lv_obj_t * | pointer to a menu page object, it will be the parent of the new menu separator object |
Returns: lv_obj_t * — pointer to the created menu separator
lv_menu_back_button_is_root
Check if an obj is a root back btn
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
bool lv_menu_back_button_is_root(lv_obj_t *menu, lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
menu | lv_obj_t * | pointer to the menu |
obj | lv_obj_t * | pointer to the back button |
Returns: bool — true if it is a root back btn
lv_menu_clear_history
Clear menu history
> Deprecated: The lv_menu widget is deprecated. See lv_example_menu_navigation.
void lv_menu_clear_history(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to the menu |
Enums
lv_menu_mode_header_t
| Name | Description |
|---|---|
LV_MENU_HEADER_TOP_FIXED | Header is positioned at the top |
LV_MENU_HEADER_TOP_UNFIXED | Header is positioned at the top and can be scrolled out of view |
LV_MENU_HEADER_BOTTOM_FIXED | Header is positioned at the bottom |
Used by 1 function
lv_menu_set_mode_header— parammode
lv_menu_mode_root_back_button_t
| Name |
|---|
LV_MENU_ROOT_BACK_BUTTON_DISABLED |
LV_MENU_ROOT_BACK_BUTTON_ENABLED |
Used by 1 function
lv_menu_set_mode_root_back_button— parammode
__lv_property_menu_id_t
| Name | Value |
|---|---|
LV_PROPERTY_MENU_MODE_HEADER | (LV_PROPERTY_MENU_START + ((int) 0 )) | (( 1 ) << 28 ) |
LV_PROPERTY_MENU_MODE_ROOT_BACK_BUTTON | (LV_PROPERTY_MENU_START + ((int) 1 )) | (( 1 ) << 28 ) |
LV_PROPERTY_MENU_END |
Macros
LV_MENU_DEPRECATED_MSG
#define LV_MENU_DEPRECATED_MSG "lv_menu is deprecated; build menu navigation from base widgets instead. See the lv_example_menu_navigation example."> Deprecated: The lv_menu widget is deprecated and kept only for backward compatibility. A menu is page navigation over base widgets: pages built from lv_obj and a back button that swaps the visible page. Build it directly instead. See the lv_example_menu_navigation example. All lv_menu_* functions below are deprecated.
Variables
lv_menu_class
const lv_obj_class_t lv_menu_classlv_menu_page_class
const lv_obj_class_t lv_menu_page_classlv_menu_cont_class
const lv_obj_class_t lv_menu_cont_classlv_menu_section_class
const lv_obj_class_t lv_menu_section_classlv_menu_separator_class
const lv_obj_class_t lv_menu_separator_classlv_menu_sidebar_cont_class
const lv_obj_class_t lv_menu_sidebar_cont_classlv_menu_main_cont_class
const lv_obj_class_t lv_menu_main_cont_classlv_menu_sidebar_header_cont_class
const lv_obj_class_t lv_menu_sidebar_header_cont_classlv_menu_main_header_cont_class
const lv_obj_class_t lv_menu_main_header_cont_classDependencies
Indirect dependencies
lv_anim.hlv_area.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_internal.hlv_display.hlv_draw.hlv_draw_arc.hlv_draw_blur.hlv_draw_buf.hlv_draw_image.hlv_draw_label.hlv_draw_line.hlv_draw_rect.hlv_draw_triangle.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_fs.hlv_grad.hlv_grid.hlv_group.hlv_image_decoder.hlv_image_dsc.hlv_indev.hlv_layout.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_symbol_def.hlv_text.hlv_timer.hlv_types.h
Last updated on