Werner , Hard to help much now--only have iPhone-- but:
It looks like the draw object didn't get it's self._Canvas attribute set-- that should happen when it is added to the canvas. If it's part of a group, then the group would have had it set, but not the sub-object. Group is not all that well tested, I suspect an object needs to be either in group or on its own, but can't be half and half. Chris may be None at that point- did the code that assigns it get called? On Feb 19, 2013, at 4:30 AM, "Werner F. Bruhin" <[email protected]> wrote: > Hi Chris, > > On 19/02/2013 08:16, Werner F. Bruhin wrote: >> Hi Chris, >> >> On 19/02/2013 06:31, Chris Barker - NOAA Federal wrote: >> >> ... >>> Not unless you added the sub-objects directly to the canvas... >> That was my problem, didn't only add directly to the canvas but also to >> the group, so no wonder delete didn't work. > Hhm, a bit to quick, I have it fixed in the "designer" which has hittest > on the group object, but in the "viewer" which has hittest on the member > of the group object I get this exception: > > AttributeError: 'NoneType' object has no attribute 'UseHitTest' > File "c:\dev\twcbv4\twcbsrc\controllers\fwinerackview.py", line 589, in > <module> > app.MainLoop() > File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line > 8660, in MainLoop > wx.PyApp.MainLoop(self) > File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line > 7952, in MainLoop > return _core_.PyApp_MainLoop(*args, **kwargs) > File "c:\dev\twcbv4\twcbsrc\libui\cpopupctrl.py", line 77, in onLeftUp > self.notify() > File "c:\dev\twcbv4\twcbsrc\libui\cpopupctrl.py", line 54, in notify > self.GetEventHandler().ProcessEvent(evt) > File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line > 4154, in ProcessEvent > return _core_.EvtHandler_ProcessEvent(*args, **kwargs) > File "c:\dev\twcbv4\twcbsrc\libui\cpopupctrl.py", line 282, in onButton > self.doPop() > File "c:\dev\twcbv4\twcbsrc\libui\cpopupctrl.py", line 294, in doPop > self.pop.display() > File "c:\dev\twcbv4\twcbsrc\libui\cpopupctrl.py", line 203, in display > self.ShowModal() > File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_windows.py", line > 805, in ShowModal > return _windows_.Dialog_ShowModal(*args, **kwargs) > File "c:\dev\twcbv4\twcbsrc\libui\searchctrl.py", line 417, in > onOLVItemSelected > self.doSetDbItem(selObj) > File "c:\dev\twcbv4\twcbsrc\libui\searchctrl.py", line 506, in doSetDbItem > self.doSetDbItemBase(item) > File "c:\dev\twcbv4\twcbsrc\libui\searchctrl.py", line 489, in > doSetDbItemBase > self.GetEventHandler().ProcessEvent(evt) > File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line > 4154, in ProcessEvent > return _core_.EvtHandler_ProcessEvent(*args, **kwargs) > File "c:\dev\twcbv4\twcbsrc\controllers\fwinerackview.py", line 176, in > onWinerack > self.viewRack(dbItem) > File "c:\dev\twcbv4\twcbsrc\controllers\fwinerackview.py", line 436, in > viewRack > self.loadRack() > File "c:\dev\twcbv4\twcbsrc\controllers\fwinerackview.py", line 448, in > loadRack > self.loadMovingGroup(mg) > File "c:\dev\twcbv4\twcbsrc\controllers\fwinerackview.py", line 495, in > loadMovingGroup > bot.Bind(fc.EVT_FC_LEFT_DOWN, self.objectHit) > File > "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\floatcanvas\FloatCanvas.py", > line 247, in Bind > self._Canvas.UseHitTest = True > > Line 495 in fwinerackview.py is the last line in the following snippet: > bot = rutils.MovingCircle((x, y), dia, > LineColor=lineColour, > LineWidth=lineWidth, > FillColor=fillColor, > FillStyle=fillStyle) > bot.rackItemId = cir.rackitemid > > #self.canvas.AddObject(bot) > > rackUnit.AddObject(bot) > print bot > bot.Bind(fc.EVT_FC_LEFT_DOWN, self.objectHit) > > and the print in the above is: > <twcbsrc.tools.rack_utils.MovingCircle instance at 0x076AC620> > > which is: > class MovingCircle(fc.Circle, MovingObjectMixin, PersistMovingCircleMixin): > """ > Circle Object that can be moved > """ > ## All we need to do is is inherit from: > ## Circle, MovingObjectMixin > def __init__(self, *args, **kwargs): > fc.Circle.__init__(self, *args, **kwargs) > PersistMovingCircleMixin.__init__(self) > > Any idea? > > Werner >> >> Thanks for the quick reply. >> >> Werner >> _______________________________________________ >> FloatCanvas mailing list >> [email protected] >> http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas >> >> > _______________________________________________ > FloatCanvas mailing list > [email protected] > http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas _______________________________________________ FloatCanvas mailing list [email protected] http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
