diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-12-08 04:16:34 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-12-08 04:16:34 +0100 |
commit | 396686a09ef471499c11256b8516c2702f761060 (patch) | |
tree | 9215d37141ae1d387fb38dd69e5dd36466012531 /src/mgui/list.c | |
parent | 319accba370d3f0872501de6386833fea140fbac (diff) |
Destroy widgets
Diffstat (limited to 'src/mgui/list.c')
-rw-r--r-- | src/mgui/list.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mgui/list.c b/src/mgui/list.c index cf39b02..58fc964 100644 --- a/src/mgui/list.c +++ b/src/mgui/list.c @@ -20,6 +20,14 @@ mgui_list* mgui_list_create(mgui_list_direction direction) { return list; } +void mgui_list_destroy(mgui_list *list) { + for(size_t i = 0; i < list->num_items; ++i) { + mgui_widget_destroy(list->items[i]); + } + mgui_free(list->items); + mgui_free(list); +} + mgui_widget* mgui_list_to_widget(mgui_list *list) { return &list->widget; } |