improve edit validator

This commit is contained in:
lixianjing 2023-12-12 17:31:05 +08:00
parent 41aa7dcf13
commit c6844fa5df

View File

@ -2377,6 +2377,7 @@ bool_t edit_is_valid_value(widget_t* widget) {
if (edit->validator != NULL) {
value_t v;
tk_object_t* obj = object_widget_create(widget);
tk_object_set_prop_pointer(obj, STR_PROP_SELF, widget);
if (fscript_eval(obj, edit->validator, &v) == RET_OK) {
TK_OBJECT_UNREF(obj);
return value_bool(&v);