diff options
author | Joel Bodenmann <joel@unormal.org> | 2014-01-04 21:10:10 +0100 |
---|---|---|
committer | Joel Bodenmann <joel@unormal.org> | 2014-01-04 21:10:10 +0100 |
commit | 3a6dd294de7a41988aca7d396a9dae5e2042bc26 (patch) | |
tree | 2d158710f3692218af1f7525503fe92c9754939b /src | |
parent | ea4464bacc88106a0cbf4508f06288faefa945fe (diff) | |
download | uGFX-3a6dd294de7a41988aca7d396a9dae5e2042bc26.tar.gz uGFX-3a6dd294de7a41988aca7d396a9dae5e2042bc26.tar.bz2 uGFX-3a6dd294de7a41988aca7d396a9dae5e2042bc26.zip |
gwinDestroy(), gwinGetFirstChild() and gwinGetNextChild()
Diffstat (limited to 'src')
-rw-r--r-- | src/gwin/gwin.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 5d3da7cb..f226294d 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -180,6 +180,15 @@ GHandle gwinGWindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pI } void gwinDestroy(GHandle gh) { + #if GWIN_NEED_HIERARCHY + // kill your children as long as you have any + while (gh->child) { + GHandle tmp = gh->child; + gh->child = gh->child->sibling; + gwinDestroy(tmp); + } + #endif + // Make the window invisible gwinSetVisible(gh, FALSE); @@ -285,12 +294,12 @@ void gwinRedraw(GHandle gh) { child->sibling = NULL; child->child = NULL; - if(!parent) + if (!parent) return; - if(last && parent->child) { + if (last && parent->child) { GHandle s = parent->child; - while(s->sibling) + while (s->sibling) s = s->sibling; s->sibling = child; } else { @@ -298,12 +307,20 @@ void gwinRedraw(GHandle gh) { parent->child = child; } } + + GHandle gwinGetFirstChild(GHandle gh) { + return gh->child; + } + + GHandle gwinGetNextChild(GHandle gh) { + return gh->sibling; + } #endif void gwinClear(GHandle gh) { /* * Don't render anything when the window is not visible but - * still call the AfterClear() routine as some widgets will + * still call return gh->child->sibling;the AfterClear() routine as some widgets will * need this to clear internal buffers or similar */ if (!((gh->flags & GWIN_FLG_VISIBLE))) { |