What do you want to achieve?
After i press the yes or no key in a messagebox, i need these keys to be disabled.
What have you tried so far?
lv_obj_t *ftr = lv_msgbox_get_footer(mbox);
lv_obj_add_state(ftr, LV_STATE_DISABLED);
Code to reproduce
/*OK key callback*/
void btn100DensOK_cb(lv_event_t *e)
{
lv_obj_t *mbox = (lv_obj_t *)lv_event_get_user_data(e);
lv_obj_t *obj = lv_msgbox_get_content(mbox);
lv_obj_t *label = lv_obj_get_child(obj, 0);
lv_label_set_text(label, "\n\nWait....");
lv_obj_t *ftr = lv_msgbox_get_footer(mbox);
lv_obj_add_state(ftr, LV_STATE_DISABLED);
msgbox2close = mbox;
set100Tmout = MBOX_TMOUT;
return;
}
//==============================================
Screenshot and/or video
Environment
- MCU/MPU/Board: ESP32S3
- LVGL version: See
lv_version.h9.4
I have a messagebox where when i press ok, i have a delay before it closes (MBOX_TMOUT aboxe).
I need the ok/cancel keys to be disabled during this time.
I am passing the messagebox to the keys callback, then doing this:
lv_obj_t *ftr = lv_msgbox_get_footer(mbox);
lv_obj_add_state(ftr, LV_STATE_DISABLED);
but it doesnt disable the keys.
Why is this ?
How can I acheive this ?
Thanks,
–Royce