Hi Chris,

I think I found it. The group "Bind" method did not change the hit colour of the children of a sub-group.

Came up with the following patch which am still testing, but so far I don't get any negative side effects.

What do you think?

Werner
Index: FloatCanvas.py
===================================================================
--- FloatCanvas.py      (revision 73571)
+++ FloatCanvas.py      (working copy)
@@ -453,15 +453,20 @@
                 self._Canvas.HitColorGenerator.next() # first call to prevent 
the background color from being used.
             # Set all contained objects to the same Hit color:
             self.HitColor = self._Canvas.HitColorGenerator.next()
-        for obj in self.ObjectList:
-            obj.SetHitPen(self.HitColor, self.HitLineWidth)
-            obj.SetHitBrush(self.HitColor)
-            obj.HitAble = True
+        self._ChangeChildrenHitColor(self.ObjectList)
         # put the object in the hit dict, indexed by it's color
         if not self._Canvas.HitDict:
             self._Canvas.MakeHitDict()
         self._Canvas.HitDict[Event][self.HitColor] = (self)
 
+    def _ChangeChildrenHitColor(self, objlist):
+        for obj in objlist:
+            obj.SetHitPen(self.HitColor, self.HitLineWidth)
+            obj.SetHitBrush(self.HitColor)
+            obj.HitAble = True
+            
+            if isinstance(obj, Group):
+                self._ChangeChildrenHitColor(obj.ObjectList)
 
     def _Draw(self, dc , WorldToPixel, ScaleWorldToPixel = None, HTdc=None):
         for obj in self.ObjectList:
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to