summaryrefslogtreecommitdiff
path: root/lib/luavgl/src/widgets/dropdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/luavgl/src/widgets/dropdown.c')
-rw-r--r--lib/luavgl/src/widgets/dropdown.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/luavgl/src/widgets/dropdown.c b/lib/luavgl/src/widgets/dropdown.c
index a211c10b..d2bcfc0b 100644
--- a/lib/luavgl/src/widgets/dropdown.c
+++ b/lib/luavgl/src/widgets/dropdown.c
@@ -36,7 +36,7 @@ LUALIB_API int luavgl_dropdown_set_property_kv(lua_State *L, void *data)
/* a base obj property? */
ret = luavgl_obj_set_property_kv(L, obj);
if (ret != 0) {
- debug("unkown property for dropdown.\n");
+ LV_LOG_ERROR("unkown property for dropdown");
}
return ret;
@@ -72,7 +72,7 @@ static int luavgl_dropdown_get(lua_State *L)
}
const char *key = lua_tostring(L, 2);
- if (strcmp(key, "list") == 0) {
+ if (lv_strcmp(key, "list") == 0) {
lv_obj_t *list = lv_dropdown_get_list(obj);
lua_pushlightuserdata(L, list);
lua_rawget(L, LUA_REGISTRYINDEX);
@@ -83,45 +83,47 @@ static int luavgl_dropdown_get(lua_State *L)
return 1;
}
- if (strcmp(key, "text") == 0) {
+ if (lv_strcmp(key, "text") == 0) {
lua_pushstring(L, lv_dropdown_get_text(obj));
return 1;
}
- if (strcmp(key, "options") == 0) {
+ if (lv_strcmp(key, "options") == 0) {
lua_pushstring(L, lv_dropdown_get_options(obj));
return 1;
}
- if (strcmp(key, "selected") == 0) {
+ if (lv_strcmp(key, "selected") == 0) {
lua_pushinteger(L, lv_dropdown_get_selected(obj));
return 1;
}
- if (strcmp(key, "option_cnt") == 0) {
+ if (lv_strcmp(key, "option_cnt") == 0) {
lua_pushinteger(L, lv_dropdown_get_option_cnt(obj));
return 1;
}
- if (strcmp(key, "selected_str") == 0) {
+ if (lv_strcmp(key, "selected_str") == 0) {
char buf[64];
lv_dropdown_get_selected_str(obj, buf, sizeof(buf));
lua_pushstring(L, buf);
return 1;
}
- if (strcmp(key, "option_index") == 0) {
+#if LV_VERSION_CHECK(8, 3, 0)
+ if (lv_strcmp(key, "option_index") == 0) {
const char *option = lua_tostring(L, 3);
lua_pushinteger(L, lv_dropdown_get_option_index(obj, option));
return 1;
}
+#endif
- if (strcmp(key, "symbol") == 0) {
+ if (lv_strcmp(key, "symbol") == 0) {
lua_pushlightuserdata(L, (void *)lv_dropdown_get_symbol(obj));
return 1;
}
- if (strcmp(key, "dir") == 0) {
+ if (lv_strcmp(key, "dir") == 0) {
lua_pushinteger(L, lv_dropdown_get_dir(obj));
return 1;
}