luat_lib_lvgl_roller_ex.c 521 B

12345678910111213141516171819202122
  1. /*
  2. @module lvgl
  3. @summary LVGL图像库
  4. @version 1.0
  5. @date 2021.06.01
  6. */
  7. #include "luat_base.h"
  8. #include "lvgl.h"
  9. #include "luat_lvgl.h"
  10. #include "luat_malloc.h"
  11. #include "luat_zbuff.h"
  12. int luat_lv_roller_get_selected_str(lua_State *L) {
  13. LV_DEBUG("CALL lv_roller_get_selected_str");
  14. lv_obj_t* roller = (lv_obj_t*)lua_touserdata(L, 1);
  15. char buf[32] = {0};
  16. lv_roller_get_selected_str(roller, buf, 32);
  17. buf[31] = 0x00;
  18. lua_pushlstring(L, buf, strlen(buf));
  19. return 1;
  20. }