On Fri, Feb 22, 2013 at 12:53 AM, Werner F. Bruhin <[email protected]> wrote:
> The Bind issue is resolved, while testing this I noted another issue > with Groups and I wonder if that could be fixed too. > > e.g. I do this: > > startPos = self.getStartPos() + 2 > > rackFrame = rutils.MovingRectangle((startPos, 0), (100, 100)) > > # add it to canvas too, otherwise next object will overlap > this one > self.canvas.AddObject(rackFrame) > rackUnit.AddObject(rackFrame) > rackUnit.Bind(fc.EVT_FC_LEFT_DOWN, self.objectHit) > > If I don't add the rackFrame to the canvas directly then the getStartPos > does not get the right position, i.e. the next object I add will be > drawn on top of the previous one. Werner, I"m not really surprised that having a MovingObject inside a MovingObjectGroup doesn't work quite right. I suspect that some extra code will need to be added when making a MovingGroup. i.e. something that adjust the positions of all the sub-objects at the end of the move. > Note that the rackUnit in this case > is a "class MovingGroup(fc.Group, MovingObjectMixin, > RackUnitPersistanceMixin):" > > def getStartPos(self): > if self.canvas.BoundingBoxDirty: > self.canvas._ResetBoundingBox() > > bBox = self.canvas.BoundingBox[1] > if bBox.IsNull(): > startPos = 0 > else: > startPos = bBox[0] > > return startPos > > Is above enough information for you, or do I need to debug it further? I"m still a bit confused about how this is all nested. If you could make a stand alone sample with a couple MovingObjects in a MovingObjectGroup, that may clarify it, and help one of us figure out where the issue is. -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [email protected] _______________________________________________ FloatCanvas mailing list [email protected] http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
