#---------------------------------------------------------------------------
class MyMiniFrame(wxMiniFrame):
- def __init__(self, parent, title, style):
- wxMiniFrame.__init__(self, parent, -1, title, style=style)
+ def __init__(self, parent, title, pos=wxDefaultPosition, size=wxDefaultSize,
+ style=wxDEFAULT_FRAME_STYLE ):
+ wxMiniFrame.__init__(self, parent, -1, title, pos, size, style)
panel = wxPanel(self, -1)
- button = wxButton(panel, 1003, "Close Me")
+ button = wxButton(panel, -1, "Close Me")
button.SetPosition(wxPoint(15, 15))
- EVT_BUTTON(self, 1003, self.OnCloseMe)
+ EVT_BUTTON(self, button.GetId(), self.OnCloseMe)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseMe(self, event):
- self.Close(true)
+ self.Close(True)
def OnCloseWindow(self, event):
+ print "OnCloseWindow"
self.Destroy()
#---------------------------------------------------------------------------
def runTest(frame, nb, log):
win = MyMiniFrame(frame, "This is a wxMiniFrame",
- wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION_HORIZ)
+ #pos=(250,250), size=(200,200),
+ style=wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION_HORIZ)
win.SetSize((200, 200))
win.CenterOnParent(wxBOTH)
frame.otherWin = win
- win.Show(true)
+ win.Show(True)
#---------------------------------------------------------------------------
overview = """\
"""
+
+
+
+
+
+if __name__ == '__main__':
+ import sys,os
+ import run
+ run.main(['', os.path.basename(sys.argv[0])])