How to disable a button

Description

Disable button

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

Any

What LVGL version are you using?

8.0.2

What do you want to achieve?

Disable button, so it is, at least, not clickable. If it can be made to appear grayed, that would be great.

What have you tried so far?

lv_obj_set_click(btn, LV_STATE_DISABLED) ;
lv_btn_set_state(btn, LV_BTN_STATE_DISABLED);
Unfortunately, both no longer exist in version 8.0.2
I also tried:
static lv_style_t style;
lv_style_init(&style);
lv_obj_add_style(btn, &style, LV_STATE_DISABLED);
It did not work. It is still clickable.

Thanks.

C:

lv_obj_add_state(btn, LV_STATE_DISABLED);

MicroPython:

btn.add_state(lv.STATE.DISABLED)

WOW, that worked !
Thanks a lot