chore: update some code and docs to use v9 API (#5876)
Co-authored-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
@@ -159,7 +159,7 @@ adjusted with :cpp:expr:`lv_obj_set_style_bg_color(obj, color)`;
|
||||
|
||||
The display background image is a path to a file or a pointer to an
|
||||
:cpp:struct:`lv_image_dsc_t` variable (converted image data) to be used as
|
||||
wallpaper. It can be set with :cpp:expr:`lv_obj_set_style_bg_img_src(obj, &my_img)`;
|
||||
wallpaper. It can be set with :cpp:expr:`lv_obj_set_style_bg_image_src(obj, &my_img)`;
|
||||
If a background image is configured the background won't be filled with
|
||||
``bg_color``.
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Pointer input devices (like a mouse) can have a cursor.
|
||||
...
|
||||
lv_indev_t * mouse_indev = lv_indev_create();
|
||||
...
|
||||
LV_IMG_DECLARE(mouse_cursor_icon); /*Declare the image source.*/
|
||||
LV_IMAGE_DECLARE(mouse_cursor_icon); /*Declare the image source.*/
|
||||
lv_obj_t * cursor_obj = lv_image_create(lv_screen_active()); /*Create an image object for the cursor */
|
||||
lv_image_set_src(cursor_obj, &mouse_cursor_icon); /*Set the image source*/
|
||||
lv_indev_set_cursor(mouse_indev, cursor_obj); /*Connect the image object to the driver*/
|
||||
|
||||
@@ -154,7 +154,7 @@ the object and all of its children.
|
||||
|
||||
void lv_obj_delete(lv_obj_t * obj);
|
||||
|
||||
:cpp:func:`lv_obj_del` will delete the object immediately. If for any reason you
|
||||
:cpp:func:`lv_obj_delete` will delete the object immediately. If for any reason you
|
||||
can't delete the object immediately you can use
|
||||
:cpp:expr:`lv_obj_delete_async(obj)` which will perform the deletion on the next
|
||||
call of :cpp:func:`lv_timer_handler`. This is useful e.g. if you want to
|
||||
|
||||
@@ -134,7 +134,7 @@ You will obtain a processed text file named `trace.systrace`, which roughly cont
|
||||
# tracer: nop
|
||||
#
|
||||
LVGL-1 [0] 2892.002993: tracing_mark_write: B|1|lv_timer_handler
|
||||
LVGL-1 [0] 2892.002993: tracing_mark_write: B|1|_lv_disp_refr_timer
|
||||
LVGL-1 [0] 2892.002993: tracing_mark_write: B|1|_lv_display_refr_timer
|
||||
LVGL-1 [0] 2892.003459: tracing_mark_write: B|1|refr_invalid_areas
|
||||
LVGL-1 [0] 2892.003461: tracing_mark_write: B|1|lv_draw_rect
|
||||
LVGL-1 [0] 2892.003550: tracing_mark_write: E|1|lv_draw_rect
|
||||
|
||||
@@ -219,8 +219,8 @@ To get a property's value from a style:
|
||||
.. code:: c
|
||||
|
||||
lv_style_value_t v;
|
||||
lv_res_t res = lv_style_get_prop(&style, LV_STYLE_BG_COLOR, &v);
|
||||
if(res == LV_RES_OK) { /*Found*/
|
||||
lv_result_t res = lv_style_get_prop(&style, LV_STYLE_BG_COLOR, &v);
|
||||
if(res == LV_RESULT_OK) { /*Found*/
|
||||
do_something(v.color);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user