summaryrefslogtreecommitdiff
path: root/iup/src/iup_attrib.c
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 02:26:30 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 02:32:26 +0200
commit7505e88db66798b2b8fcdff2d92a7136cd826b5b (patch)
treeb6ced565318f8e8112e35cb0ad53abe4212ef8de /iup/src/iup_attrib.c
parente9a184546b18cf3b796bd560561f312934004c54 (diff)
Upgrading to IUP 3.2 - and cleaning up.
Diffstat (limited to 'iup/src/iup_attrib.c')
-rwxr-xr-xiup/src/iup_attrib.c33
1 files changed, 33 insertions, 0 deletions
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;