Add widget_remove()

This commit is contained in:
Pim van Pelt
2017-11-25 01:48:23 +01:00
parent 4f64ed554a
commit 3a8aeb5e0f

View File

@ -73,17 +73,14 @@ struct widget_t *widget_find(uint16_t x, uint16_t y) {
} }
void widget_remove(struct widget_t *widget) { void widget_remove(struct widget_t *widget) {
// struct widget_list_t *wl, *wlt; struct widget_list_t *wl;
if (!widget) if (!widget)
return; return;
/* SLIST_FOREACH(wl, &s_widgets, entries) {
SLIST_FOREACH_SAFE(wl, &s_widgets, entries, wlt) {
if (wl->widget == widget) { if (wl->widget == widget) {
SLIST_REMOVE(&s_widgets, wl, widget_t, entries); SLIST_REMOVE(&s_widgets, wl, widget_list_t, entries);
free(wl); widget_destroy(widget);
} }
} }
*/
} }