Hi Werner, On Mon, Feb 18, 2013 at 10:30 AM, Werner F. Bruhin <[email protected]> wrote:
> When I need to delete an object I do: > > if self._selectedObject: > runit = > self.ds.query(db.Wineracku).get(self._selectedObject.rackUnitId) > self.doListItemDelete(runit) > self.canvas.RemoveObject(self._selectedObject) > self._rackModulesCount -= 1 > self._rackModules.remove(self._selectedObject) > self._selectedObject = None > self.canvas.ZoomToBB() > self.canvas.Draw(True) > After above code the related database items are gone (doListItemDelete) > but the _selectedObject is still shown on the canvas, I have to close > and reload to see the change. > > What step am I missing in the delete? > That sure should do it. > BTW, the _selectedObject is an > "fc.Group" type object. Do I have to remove the objects which are > grouped by this selected object individually? Not unless you added the sub-objects directly to the canvas... I've enclosed a demo app that puts a couple groups on the canvas, and removes then when you click the "remove" button -- it works fine for me (wxPython2.8, on a Mac). Do note that if you click the "ReplaceA" (or B) button more than once, it will put multiple references to the object on the canvas, so you have to click "RemoveA" multiple times as well. Is there a chance that in your code, you've added the group in question more than once? -Chris -- 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]
GroupDeleteDemo.py
Description: Binary data
_______________________________________________ FloatCanvas mailing list [email protected] http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
