Extending lv_slider

Hello kisvegabor,

I read the following articles in details:

[ How to make template out of components?](How to make template out of components?)

Extend the functionality of objects in LittlevGL

I’m trying to do something close to that, create a my own version of a vertical slider, by extending lv_slider, with a name label on top and a value label at the bottom.

If you have done something similar in one of your project, would you be able to share your code?

I’m struggling to grasp how to extend existing widgets properly, there’s something I’m not able to understand yet. My main issue is the alignment of the name and value label on top and at the bottom of the slider.

Kind regards,

Vincent

If you’re using 7.x, the lv_demo_widgets example (second on that page) (code here) shows how to create sliders with associated values. It doesn’t require you to extend the slider itself.

Thank you. I managed to extend lv_slider in the end, it wasn’t as complicated as I tough.
Basically I followed the article about extending functionality, and in my gui_slider_design function I’m realigning the labels.