# HG changeset patch # User Olaf Wintermann # Date 1541774626 -3600 # Node ID 8a4451fcb736d7f6213d2c38141b244236e1816f # Parent ee49d1852a5fd19d9b92c776837e9d403eddfe64 fixes ui_textfield_set (Motif) diff -r ee49d1852a5f -r 8a4451fcb736 application/main.c --- a/application/main.c Sun Jul 01 19:03:26 2018 +0200 +++ b/application/main.c Fri Nov 09 15:43:46 2018 +0100 @@ -97,26 +97,26 @@ Document *doc = ui_document_new(sizeof(Document)); UiContext *ctx = ui_document_context(doc); - doc->text = ui_text_new(ctx, "text"); + //doc->text = ui_text_new(ctx, "text"); doc->t1 = ui_string_new(ctx, "t1"); - doc->t2 = ui_string_new(ctx, "t2"); - doc->t3 = ui_string_new(ctx, "t3"); + //doc->t2 = ui_string_new(ctx, "t2"); + //doc->t3 = ui_string_new(ctx, "t3"); - doc->i = ui_int_new(ctx, "int"); - doc->d = ui_double_new(ctx, "d"); - doc->r = ui_range_new(ctx, "r"); + //doc->i = ui_int_new(ctx, "int"); + //doc->d = ui_double_new(ctx, "d"); + //->r = ui_range_new(ctx, "r"); - doc->progress = ui_double_new(ctx, "progress"); + //doc->progress = ui_double_new(ctx, "progress"); - doc->list = ui_list_new(ctx, "list"); + //doc->list = ui_list_new(ctx, "list"); Entry *e1 = calloc(1, sizeof(Entry)); e1->name = "test"; e1->desc = "test file"; Entry *e2 = calloc(1, sizeof(Entry)); e2->name = str; e2->desc = "important document"; - ui_list_append(doc->list, e1); - ui_list_append(doc->list, e2); + //ui_list_append(doc->list, e1); + //ui_list_append(doc->list, e2); return doc; } diff -r ee49d1852a5f -r 8a4451fcb736 ui/common/context.c --- a/ui/common/context.c Sun Jul 01 19:03:26 2018 +0200 +++ b/ui/common/context.c Fri Nov 09 15:43:46 2018 +0100 @@ -90,7 +90,7 @@ UCX_MAP_FOREACH(key, var, i) { UiVar *v = ucx_map_get(root->bound, key); if(v) { - // copy binding: after this all doc vars with names of previously + // copy binding: after this, all doc vars with names of previously // bound variables are bound to the widgets // the widgets still hold a pointer to the root ctx vars, but this // vars have a pointer to the document variable value - confusing diff -r ee49d1852a5f -r 8a4451fcb736 ui/motif/text.c --- a/ui/motif/text.c Sun Jul 01 19:03:26 2018 +0200 +++ b/ui/motif/text.c Fri Nov 09 15:43:46 2018 +0100 @@ -462,10 +462,10 @@ } void ui_textfield_set(UiString *str, char *value) { + XmTextSetString(str->obj, value); if(str->value.ptr) { str->value.free(str->value.ptr); } str->value.ptr = NULL; - XmTextSetString(str->obj, value); }