diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gwin/gwin.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 6b9cb81e..3a4ae5b5 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -167,7 +167,15 @@ color_t gwinGetDefaultBgColor(void) { GHandle gwinGWindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit) { if (!(pgw = _gwindowCreate(g, pgw, pInit, &basegwinVMT, 0))) return 0; + + #if GWIN_NEED_HIERARCHY + pgw->parent = NULL; + pgw->sibling = NULL; + pgw->child = NULL; + #endif + gwinSetVisible(pgw, pInit->show); + return pgw; } @@ -250,6 +258,27 @@ void gwinRedraw(GHandle gh) { } #endif +#if GWIN_NEED_HIERARCHY + void gwinAddChild(GHandle parent, GHandle child, bool_t last) + { + child->parent = parent; + child->sibling = NULL; + child->child = NULL; + + if(!parent) + return; + + if(last && parent->child) { + GHandle s = parent->child; + while(s->sibling) s = s->sibling; + s->sibling = child; + } else { + child->sibling = parent->child; + parent->child = child; + } + } +#endif + void gwinClear(GHandle gh) { /* * Don't render anything when the window is not visible but |