hello,
my second question in moving a ogl-shape,
"how to remove the old shape, after the new shape is drawn ?"
was lost in the other weird problems.
thanks,
Stef Mientki
Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of Commerce - trade register 41055629
Hi,
Did you try to redraw the canvas ? (somewhat a hammer for a fly, but one has to start somewhere ;))
Matthieu
···
2007/6/25, Stef Mientki < S.Mientki@ru.nl>:
hello,
my second question in moving a ogl-shape,
“how to remove the old shape, after the new shape is drawn ?”
was lost in the other weird problems.
thanks,
Stef Mientki
Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of Commerce - trade register 41055629
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org
Stef Mientki <S.Mientki <at> ru.nl> writes:
hello,
my second question in moving a ogl-shape,
"how to remove the old shape, after the new shape is drawn ?"
was lost in the other weird problems.
thanks,
Stef Mientki
Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of
Commerce - trade register 41055629
Hi,
For erasing shapes, your diagram (the one you specified in SetDiagram) has a
RemoveShape method. You have to make sure you redraw the canvas every time you
make such changes as erasing, adding and moving shapes. Therefore, your code
will have something like this:
dc = wx.ClientDC(self)
self.PrepareDC(dc)
....
shape.Show(False)
self.diagram.RemoveShape(shape)
self.canvas.Redraw(dc)# i think its the same as self.diagram.Redraw()
To clear the whole canvas, use <your canvas>.Clear(dc)
I hope that helps.
Regards,
Simon
Simon and Matthieu thanks for your answers,
but it still is quit a problem for me:
I tried this code,
which indeed removes it from the diagram, beccuse I can't drag and drop the ogl shape anymore,
but nothing is repainted, so the image is still there.
I tested both Redraw of the container (descendant of ShapeCanvas, taken from the wxPython demo),
and Redraw of the diagram and in several combinations of them,
nothing seems to get rid of that old image 
LED.shape.Show(False)
self.Shape_Container.diagram.RemoveShape(LED.shape)
dc = wx.ClientDC ( self.Shape_Container )
self.Shape_Container.PrepareDC ( dc )
self.Shape_Container.diagram.Redraw (dc)
self.Shape_Container.Redraw (dc)
I also tried this, without success
LED.shape.Show(False)
dc = wx.ClientDC ( self.Shape_Container )
self.Shape_Container.PrepareDC ( dc )
self.Shape_Container.Redraw (dc)
LED.shape.SetX(LED.shape.GetX()+20)
LED.shape.Show(True)
dc = wx.ClientDC ( self.Shape_Container )
self.Shape_Container.PrepareDC ( dc )
self.Shape_Container.Redraw (dc)
Any other ideas,
or maybe someone has an example ?
cheers,
Stef
simon kagwe wrote:
···
Stef Mientki <S.Mientki <at> ru.nl> writes:
hello,
my second question in moving a ogl-shape,
"how to remove the old shape, after the new shape is drawn ?"
was lost in the other weird problems.
thanks,
Stef Mientki
Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of
Commerce - trade register 41055629
Hi,
For erasing shapes, your diagram (the one you specified in SetDiagram) has a RemoveShape method. You have to make sure you redraw the canvas every time you make such changes as erasing, adding and moving shapes. Therefore, your code will have something like this:
dc = wx.ClientDC(self)
self.PrepareDC(dc)
....
shape.Show(False)
self.diagram.RemoveShape(shape)
self.canvas.Redraw(dc)# i think its the same as self.diagram.Redraw()
To clear the whole canvas, use <your canvas>.Clear(dc)
I hope that helps.
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Sorry, I thought about Refresh() not Redraw()
(on one of the parent of the diagram or the diagram itself, I think)
Matthieu
···
2007/6/25, Stef Mientki < s.mientki@ru.nl>:
Simon and Matthieu thanks for your answers,
but it still is quit a problem for me:
I tried this code,
which indeed removes it from the diagram, beccuse I can’t drag and drop
the ogl shape anymore,
but nothing is repainted, so the image is still there.
I tested both Redraw of the container (descendant of ShapeCanvas, taken
from the wxPython demo),
and Redraw of the diagram and in several combinations of them,
nothing seems to get rid of that old image 
LED.shape.Show(False)
self.Shape_Container.diagram.RemoveShape
(LED.shape)
dc = wx.ClientDC ( self.Shape_Container )
self.Shape_Container.PrepareDC ( dc )
self.Shape_Container.diagram.Redraw (dc)
self.Shape_Container.Redraw (dc)
I also tried this, without success
LED.shape.Show(False)
dc = wx.ClientDC ( self.Shape_Container )
self.Shape_Container.PrepareDC ( dc )
self.Shape_Container.Redraw (dc)
LED.shape.SetX(LED.shape.GetX()+20)
LED.shape.Show(True)
dc = wx.ClientDC ( self.Shape_Container )
self.Shape_Container.PrepareDC ( dc )
self.Shape_Container.Redraw (dc)
Any other ideas,
or maybe someone has an example ?
cheers,
Stef
simon kagwe wrote:
Stef Mientki <S.Mientki ru.nl> writes:
hello,
my second question in moving a ogl-shape,
“how to remove the old shape, after the new shape is drawn ?”
was lost in the other weird problems.
thanks,
Stef Mientki
Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of
Commerce - trade register 41055629
Hi,
For erasing shapes, your diagram (the one you specified in SetDiagram) has a
RemoveShape method. You have to make sure you redraw the canvas every time you
make such changes as erasing, adding and moving shapes. Therefore, your code
will have something like this:
dc = wx.ClientDC(self)
self.PrepareDC(dc)
…
shape.Show
(False)
self.diagram.RemoveShape(shape)
self.canvas.Redraw(dc)# i think its the same as self.diagram.Redraw()
To clear the whole canvas, use .Clear(dc)
I hope that helps.
Regards,
Simon
To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Stef Mientki <s.mientki <at> ru.nl> writes:
LED.shape.Show(False)
self.Shape_Container.diagram.RemoveShape(LED.shape)
dc = wx.ClientDC ( self.Shape_Container )
self.Shape_Container.PrepareDC ( dc )
self.Shape_Container.diagram.Redraw (dc)
self.Shape_Container.Redraw (dc)
Try this:
dc = wx.ClientDC ( self.Shape_Container )
self.Shape_Container.PrepareDC ( dc )
LED.shape.Show(False) #AFTER PrepareDC
self.Shape_Container.diagram.RemoveShape(LED.shape) #AFTER PrepareDC
self.Shape_Container.diagram.Redraw (dc)
It should work. Note that self.Shape_Container should be the canvas i.e a
subclass of ShapeCanvas.