ui/common/context.c

branch
newapi
changeset 192
bcacd00ea955
parent 187
24ce2c326d85
child 232
e2b33055113f
--- a/ui/common/context.c	Sun Oct 01 17:22:17 2023 +0200
+++ b/ui/common/context.c	Sun Oct 01 18:54:23 2023 +0200
@@ -247,6 +247,18 @@
     return val;
 }
 
+
+UiVar* uic_widget_var(UiContext* toplevel, UiContext* current, void* value, const char* varname, UiVarType type) {
+    if (value) {
+        return uic_create_value_var(current, value);
+    }
+    if (varname) {
+        return uic_create_var(toplevel, varname, type);
+    }
+    return NULL;
+}
+
+
 void uic_copy_binding(UiVar *from, UiVar *to, UiBool copytodoc) {
     // check type
     if(from->type != to->type) {

mercurial