]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/wxMiniFrame.py
Some little tweaks for debugging
[wxWidgets.git] / wxPython / demo / wxMiniFrame.py
... / ...
CommitLineData
1
2from wxPython.wx import *
3
4#---------------------------------------------------------------------------
5class MyMiniFrame(wxMiniFrame):
6 def __init__(self, parent, title, pos=wxDefaultPosition, size=wxDefaultSize,
7 style=wxDEFAULT_FRAME_STYLE ):
8 wxMiniFrame.__init__(self, parent, -1, title, pos, size, style)
9 panel = wxPanel(self, -1)
10
11 button = wxButton(panel, -1, "Close Me")
12 button.SetPosition(wxPoint(15, 15))
13 EVT_BUTTON(self, button.GetId(), self.OnCloseMe)
14 EVT_CLOSE(self, self.OnCloseWindow)
15
16 def OnCloseMe(self, event):
17 self.Close(True)
18
19 def OnCloseWindow(self, event):
20 print "OnCloseWindow"
21 self.Destroy()
22
23#---------------------------------------------------------------------------
24
25def runTest(frame, nb, log):
26 win = MyMiniFrame(frame, "This is a wxMiniFrame",
27 #pos=(250,250), size=(200,200),
28 style=wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION_HORIZ)
29 win.SetSize((200, 200))
30 win.CenterOnParent(wxBOTH)
31 frame.otherWin = win
32 win.Show(True)
33
34
35#---------------------------------------------------------------------------
36
37
38
39
40
41
42
43
44
45
46overview = """\
47"""
48
49
50
51
52
53if __name__ == '__main__':
54 import sys,os
55 import run
56 run.main(['', os.path.basename(sys.argv[0])])