Add widget_remove()
This commit is contained in:
11
src/widget.c
11
src/widget.c
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user