[Simulator] How to add a meter on a newly created tag

What MCU/Processor/Board and compiler are you using?

Code Blocks c/c++ compiler.

What LVGL version are you using?

the package of the simulator. Do not know the release version.

What do you want to achieve?

Add a meter onto the newly created tab

What have you tried so far?

Successfully create a new lv_obj_t * tab and add a function called meter_create(), but failed at the unknown function lv_linemeter_create() in the sample code of meter provided on the webpage of lvgl docs. Where can I find the position of this function?

Code to reproduce

    /*Create a line meter */
    lv_obj_t * lmeter;
    lmeter = lv_linemeter_create(lv_scr_act(), NULL);
    lv_linemeter_set_range(lmeter, 0, 100);                   /*Set the range*/
    lv_linemeter_set_value(lmeter, 80);                       /*Set the current value*/
    lv_linemeter_set_scale(lmeter, 240, 21);                  /*Set the angle and number of lines*/
    lv_obj_set_size(lmeter, 150, 150);
    lv_obj_align(lmeter, NULL, LV_ALIGN_CENTER, 0, 0);

It sounds like you’re using version 6.x but reading the version 7.x documentation. This would be the page for the 6.x line meter documentation, or you can download a fresh copy of the CodeBlocks project which I recently updated to 7.3.

Thank you, I can now successfully rebuild the project and run the demo.
However, a new problem occurred. The linemeter I created appears on every tab of the demo, not what I wanted as only shown on one specific tab. How can I fix this problem?

You should create it as a child of one of the tab objects in the demo instead of lv_scr_act().

Thank you. That really solve my problem.