ecere/gui/Stacker: Fix to UpdateControls() to ignore non-client controls (e.g. Window...
authorJerome St-Louis <jerome@ecere.com>
Tue, 24 Jul 2012 20:19:01 +0000 (16:19 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 24 Jul 2012 20:19:01 +0000 (16:19 -0400)
ecere/src/gui/controls/Stacker.ec

index caed125..f21edd5 100644 (file)
@@ -314,15 +314,18 @@ private:
    {
       Window child;
       Array<Window> newControls { };
-      for(c : controls)
+      for(c : controls; !c.nonClient)
       {
-         for(child = firstChild; child; child = child.next)
+         child = null;
+         if(!c.destroyed)
          {
-            if(child.nonClient) continue;
-            if(c == child)
+            for(child = firstChild; child; child = child.next)
             {
-               newControls.Add(child);
-               break;
+               if(c == child)
+               {
+                  newControls.Add(child);
+                  break;
+               }
             }
          }
          if(!child)
@@ -454,7 +457,7 @@ private:
          if(bits.scrollable)
          {
             // FOR WHEN SCROLLING OCCURED
-            for(child : controls)
+            for(child : controls; !child.nonClient && child.visible)
                child.anchor = child.anchor;
 
             if(direction == horizontal)