--- a/ui/win32/grid.c Wed Oct 08 07:53:57 2025 +0200 +++ b/ui/win32/grid.c Wed Oct 08 09:46:23 2025 +0200 @@ -31,10 +31,10 @@ #include "../../ucx/cx/array_list.h" #include "../common/context.h" -UiGridLayout* ui_grid_container(UiObject *obj, HWND control, short padding, short columnspacing, short rowspacing) { - UiGridLayout *grid = cxZalloc(obj->ctx->allocator, sizeof(UiGridLayout)); +UiGridLayout* ui_grid_container(const CxAllocator *a, HWND control, short padding, short columnspacing, short rowspacing) { + UiGridLayout *grid = cxZalloc(a, sizeof(UiGridLayout)); grid->hwnd = control; - grid->widgets = cxArrayListCreate(obj->ctx->allocator, NULL, sizeof(GridElm), 32); + grid->widgets = cxArrayListCreate(a, NULL, sizeof(GridElm), 32); grid->padding = padding; grid->columnspacing = columnspacing; grid->rowspacing = rowspacing; @@ -50,10 +50,14 @@ { GridElm elm; elm.widget = widget; - elm.x = x; - elm.y = y; + elm.posx = 0; + elm.posy = 0; + elm.width = 0; + elm.height = 0; + elm.gridx = x; + elm.gridy = y; elm.layout = *layout; - cxListAdd(grid->widgets, elm); + cxListAdd(grid->widgets, &elm); } void ui_grid_layout(UiGridLayout *grid) {