Werner, I looked a bit more into your issue if binding to objects within a Group:
Putting the object both in the group and by itself is fine -- it will result in it being drawn twice, but no big deal. It also will change the draw order, which may not be ideal in some instances. However, to do it right: First, a kludge: the issue is that when added to the canvas as part of a Group, an individual object doesn't get a reference to the canvas -- but you can add one by hand: TheObject._Canvas = TheCanvas or TheObject._Canvas = TheGroup._Canvas # after the group has been added to the canvas. But I've also fixed the issue, but adding a bit of code to the Group code. So you could grab the latest version from SVN: http://svn.wxwidgets.org/svn/wx/wxPython/3rdParty/FloatCanvas/ and binding to a sub-object should "just work". -Chris On Tue, Feb 19, 2013 at 11:02 AM, Werner F. Bruhin <[email protected]> wrote: > Hi Chris, > > On 19/02/2013 19:00, Chris Barker - NOAA Federal wrote: >> Werner , >> >> Hard to help much now--only have iPhone-- but: > Nothing urgent. >> >> 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. > It is in the group, but then I can't bind a "fc.EVT_FC_LEFT_DOWN". > > If I do canvas.AddObject and groupObj.AddObject in the viewer then I can > do the bind, as if the groupObj.AddObject does not add "self._Canvas" to > the object one adds to the group object. > > No big deal as doing "my" dual add in the "viewer" works for me, and > doesn't seem to have any undesired side effects. > > In the designer I only add to the group and there it works too, but in > the designer I only need to select the group and not the item within a > group. > > Have a nice day > Werner > _______________________________________________ > FloatCanvas mailing list > [email protected] > http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas -- 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
