From 7505e88db66798b2b8fcdff2d92a7136cd826b5b Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 9 Sep 2010 02:26:30 +0200 Subject: Upgrading to IUP 3.2 - and cleaning up. --- iup/src/iup_attrib.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'iup/src/iup_attrib.c') diff --git a/iup/src/iup_attrib.c b/iup/src/iup_attrib.c index bf9576e..cc7ff02 100755 --- a/iup/src/iup_attrib.c +++ b/iup/src/iup_attrib.c @@ -264,6 +264,39 @@ void IupStoreAttribute(Ihandle *ih, const char* name, const char *value) } } +static void iAttribResetChildren(Ihandle *ih, const char* name) +{ + Ihandle* child = ih->firstchild; + while (child) + { + /* set only if an inheritable attribute at the child */ + if (iAttribIsInherit(child, name)) + { + iupAttribSetStr(child, name, NULL); + + iAttribResetChildren(child, name); + } + + child = child->brother; + } +} + +void IupResetAttribute(Ihandle *ih, const char* name) +{ + iupASSERT(name!=NULL); + if (!name) + return; + + iupASSERT(iupObjectCheck(ih)); + if (!iupObjectCheck(ih)) + return; + + iupAttribSetStr(ih, name, NULL); + + if (iAttribIsInherit(ih, name)) + iAttribResetChildren(ih, name); +} + char* IupGetAttribute(Ihandle *ih, const char* name) { int inherit; -- cgit v1.2.3