improve box creation
This commit is contained in:
parent
af3066ab7b
commit
6aeb2124d9
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue