improve box creation

This commit is contained in:
jacekpoz 2024-08-12 23:49:39 +02:00
parent af3066ab7b
commit 6aeb2124d9
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -131,10 +131,10 @@ bool ptk_init(size_t width, size_t height, const char *title, PtkVersion applica
}
PtkHandle ptk_box(size_t child_count, PtkHandle *children) {
PtkBox *ret = malloc(sizeof(PtkBox));
PtkComponent *ret = malloc(sizeof(PtkComponent));
ret->type = PTK_COMPONENT_TYPE_BOX;
ret->child_count = child_count;
ret->children = children;
ret->children = PTK_LIST_NEW(PtkHandle, child_count);
PTK_LIST_ADD_ALL_P(PtkHandle, ret->children, children, child_count);
return (PtkHandle)ret;
}