Hi! Im using ogl and creating shapes like a rectangle like this in the code. When I create I create a wxframe together this shape for when I click in the shape I want that open this window(wxframe). But the problem is that I can just open one time. In the second I have an error. What could I do for fix this problem.
Diego
self.shapes=[]
def Prop(self, event):
for self.s in self.shapes:
if self.s[0].Selected():
janela=self.s[1]
janela.Show(true)
def Draw(self, event):
shape=wxRectangleShape(50,50)
shape.SetX(event.GetX())
shape.SetY(event.GetY())
self.rightwin.diagram.AddShape(shape)
self.rightwin.Refresh()
shape.Show(true)
evthandler = MyEvent()
evthandler.SetShape(shape)
evthandler.SetPreviousHandler(shape.GetEventHandler())
shape.SetEventHandler(evthandler)
d = []
self.contador = self.contador + 1
frame = wxFrame(self, -1, "Objeto #%d" % self.contador)
wxStaticText(frame, -1, "%dx%d" % (event.GetX(),event.GetY()), wxPoint(10,10))
d.append(shape)
d.append(frame)
self.shapes.append(d)