Important: unclear posts may not receive useful answers.
Before posting
- Get familiar with Markdown to format and structure your post
- Be sure to update lvgl from the latest version from the
master
branch.- Read the
Delete this section if you read and applied the mentioned points.
Description
Hi,
I’m new to lvgl and tried to do some modification on the demo files. And this fits. Now I’m tried to do some more modification and run in a problem.
I generate just an object and set values for height, width and position. For simualtion is set display size 240x320. In simulation I can see an empty “body” at the expected position and with the expected size.
But when I read back the width and height of the object, I get 0 as height and width.
In cause of the “right looking” in simulation, I would expect to see the values in the object by debugger. But there is nothing to see. So I’m confused.
The nearly same code is used in lvgl-academy in the widget-base-object
What MCU/Processor/Board and compiler are you using?
WindowsSimulation, VisualStudio22
What do you want to achieve?
I would expect to see the setted values, if I use the lv_obj_get_height or _width
What have you tried so far?
Code to reproduce
lv_obj_t* obj1 = lv_obj_create(lv_scr_act());
lv_obj_set_width(obj1, 50);
lv_obj_set_height(obj1, 50);
lv_obj_set_pos(obj1, 100, 100);
lv_coord_t w = lv_obj_get_width(obj1);
lv_coord_t h = lv_obj_get_height(obj1);
printf("width = %d, height = %d\n", w,h);
The output:
width = 0, height = 0