245 } |
245 } |
246 } |
246 } |
247 return val; |
247 return val; |
248 } |
248 } |
249 |
249 |
|
250 |
|
251 UiVar* uic_widget_var(UiContext* toplevel, UiContext* current, void* value, const char* varname, UiVarType type) { |
|
252 if (value) { |
|
253 return uic_create_value_var(current, value); |
|
254 } |
|
255 if (varname) { |
|
256 return uic_create_var(toplevel, varname, type); |
|
257 } |
|
258 return NULL; |
|
259 } |
|
260 |
|
261 |
250 void uic_copy_binding(UiVar *from, UiVar *to, UiBool copytodoc) { |
262 void uic_copy_binding(UiVar *from, UiVar *to, UiBool copytodoc) { |
251 // check type |
263 // check type |
252 if(from->type != to->type) { |
264 if(from->type != to->type) { |
253 fprintf(stderr, "UI Error: var has incompatible type.\n"); |
265 fprintf(stderr, "UI Error: var has incompatible type.\n"); |
254 return; |
266 return; |