Description
Hi all,
I started using littlevgl last week and im very pleased with what i have done in such a short time. ive been try for days to make a gui using gfx library and it was so tedious i searched for better ways and luckily found littlevgl.
First I’m not a pro programmer but i think i understand enough to get by. Building the GUI for me was made easy. I hope to complete this project im starting to enjoy. Please help.
More event handling sample codes/tutorial please.
What MCU/Processor/Board and compiler are you using?
ESP32 Dev Module
What do you want to achieve?
Some head up to make the GUI functional
What have you tried so far?
Code to reproduce
Just an example
static const char * btnmKB_map[]= {"1","2","3","\n",
"4","5","6","\n",
"7","8","9","\n",
"0"," ","\n",
"X","Y","Z","\n",
"G","M","F","\n",
"Send",""};
lv_obj_t *btnmKB = lv_btnm_create(tab1,NULL);
lv_btnm_set_map (btnmKB, btnmKB_map);
lv_obj_set_size(btnmKB,100,240);
lv_obj_align(btnmKB, NULL, LV_ALIGN_CENTER, -180,16);
lv_obj_set_event_cb(btnmKB, [](lv_obj_t *obj, lv_event_t event) {
if (event == LV_EVENT_CLICKED) {
const char* txt = lv_btnm_get_active_btn_text(obj);
printf("%s was pressed\n", txt);
//send text to text area taGC
//lv_ta_set_text(taGC, txt);
}
});
lv_obj_t *taGC = lv_ta_create(tab1, NULL);
lv_obj_set_size(taGC, 250,28);
lv_obj_align(taGC, NULL, LV_ALIGN_CENTER, 0, -90);
lv_ta_set_text(taGC, "");