gui: allow custom add_child callback
This commit is contained in:
parent
d55fb31e21
commit
ec9f41f1ab
|
@ -12,6 +12,7 @@ extern "C"
|
|||
|
||||
struct gui_common
|
||||
{
|
||||
void (*add_child)(struct gui_common *parent, struct gui_common *child);
|
||||
int (*update)(struct gui_common *, const union peripheral *,
|
||||
const struct camera *);
|
||||
int (*render)(const struct gui_common *);
|
||||
|
|
|
@ -69,6 +69,9 @@ void gui_add_child(struct gui_common *const p,
|
|||
p->child = c;
|
||||
|
||||
c->parent = p;
|
||||
|
||||
if (p->add_child)
|
||||
p->add_child(p, c);
|
||||
}
|
||||
|
||||
int gui_update(struct gui_common *const g, const union peripheral *const p,
|
||||
|
|
Loading…
Reference in New Issue