Tue, 18 Nov 2025 17:26:15 +0100
fix wrong arg count in frame creation (Motif)
| application/demo_bindings.c | file | annotate | diff | comparison | revisions | |
| ui/motif/container.c | file | annotate | diff | comparison | revisions |
--- a/application/demo_bindings.c Tue Nov 18 16:47:48 2025 +0100 +++ b/application/demo_bindings.c Tue Nov 18 17:26:15 2025 +0100 @@ -90,21 +90,19 @@ ui_grid(obj, .margin = 10, .columnspacing = 10, .rowspacing = 10, .fill = TRUE) { ui_rlabel(obj, .label = "Document:"); - ui_llabel(obj, .varname = "id", .hfill = TRUE, .vfill = TRUE); + ui_llabel(obj, .varname = "id", .hfill = TRUE, .hexpand = TRUE, .vfill = TRUE); ui_newline(obj); ui_rlabel(obj, .label = "Name:"); - ui_llabel(obj, .varname = "name", .hfill = TRUE, .vfill = TRUE); + ui_llabel(obj, .varname = "name", .hfill = TRUE, .hexpand = TRUE, .vfill = TRUE); ui_newline(obj); ui_combobox(obj, .varname = "doclist", .colspan = 2, .onactivate = switch_document, .getvalue = doclist_get_value, .colspan = 2, .hfill = TRUE); ui_newline(obj); - ui_frame(obj, .label = "Document", .colspan = 2, .fill = TRUE) { - ui_grid(obj, .margin = 10, .columnspacing = 10, .rowspacing = 10, .fill = TRUE) { - ui_rlabel(obj, .label = "Name:", .vfill = TRUE); - ui_textfield(obj, .varname = "input_name", .onchange = update_name); - } + ui_frame(obj, .label = "Document", .colspan = 2, .fill = TRUE, .subcontainer = UI_CONTAINER_GRID, .columnspacing = 10, .rowspacing = 10, .padding = 10) { + ui_rlabel(obj, .label = "Name:", .vfill = TRUE); + ui_textfield(obj, .varname = "input_name", .onchange = update_name); } }
--- a/ui/motif/container.c Tue Nov 18 16:47:48 2025 +0100 +++ b/ui/motif/container.c Tue Nov 18 17:26:15 2025 +0100 @@ -251,7 +251,7 @@ Widget parent = ui_container_prepare(ctn, &layout, xargs, &n); char *name = args->name ? (char*)args->name : "frame"; - Widget frame = XmCreateFrame(parent, name, xargs, 6); + Widget frame = XmCreateFrame(parent, name, xargs, n); XtManageChild(frame); ui_container_add(ctn, frame); @@ -271,7 +271,8 @@ UiContainerArgs sub_args = { .spacing = args->spacing, .columnspacing = args->columnspacing, - .rowspacing = args->rowspacing + .rowspacing = args->rowspacing, + .margin = args->padding }; switch(args->subcontainer) { default: break;