wx.lib.ogl - how to remove shape

Werner F. Bruhin wrote:

Some more questions to ogl.

I could only implement the removing of a shape by saving a reference in the OnLeftClick event, could not find a method to find the currently selected shape - is this correct?

When I try to remove a shape either with:

shape.RemoveFromCanvas(canvas)

or with:

self.RemoveShape(shape)

The display shows that the shape is removed (after doing a refresh) using either method, however the shape is not being removed from the "shapes" list (see the demo MyAddShape).

Just looked at MyAddShape again, the "shapes" list is not part of ogl, but it is part of the demo code. So, to answer my own question I guess I will have to do the removal in my code, is this correct too?

If you are maintaining your own list of shapes, then yes.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!