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