Draws in wxShapeCanvas

Hello!
I have a wxShapeCanvas but when I use the mouse for insert a circle(for example) I just can see the draw if I move his position with the mouse else its stay 'hidden'. I dont know whats happening because I use the same commands when I create a static draw. Here is some part of the code if someone could help, tks.
Diego

        self.rightwin = MyShape(self,20,wxPoint(self.size[0],0),wxSize(300,300))
        self.shapes=[]
        self.form=0
        EVT_RIGHT_UP(self.rightwin, self.Draw)

    def Draw(self, event):
        if (self.form == 1):
            shape=wxRectangleShape(50,50)
            shape.SetX(event.GetX())
            shape.SetY(event.GetY())
            self.rightwin.diagram.AddShape(shape)
            shape.Show(true)
            self.shapes.append(shape)
        if (self.form == 2):
            shape=wxCircleShape(50)
            shape.SetX(event.GetX())
            shape.SetY(event.GetY())
            self.rightwin.diagram.AddShape(shape)
            shape.Show(true)
            self.shapes.append(shape)

class MyShape(wxShapeCanvas):
    def __init__(self, parent, ID, pos, size):
        wxShapeCanvas.__init__(self, parent, ID, pos=wxPoint(40,0), size=wxSize(300,300))
        self.SetBackgroundColour(wxWHITE)
        self.diagram = wxDiagram()
        self.SetDiagram(self.diagram)
        self.diagram.SetCanvas(self)

Diego Prestes wrote:

Hello!
I have a wxShapeCanvas but when I use the mouse for insert a circle(for example) I just can see the draw if I move his position with the mouse else its stay 'hidden'. I dont know whats happening because I use the same commands when I create a static draw. Here is some part of the code

Does calling shape.SetCanvas(self) help? How about self.Refresh()?

···

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