]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxFrame.py
2 from wxPython
.wx
import *
4 #---------------------------------------------------------------------------
6 class MyFrame(wxFrame
):
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
)
10 panel
= wxPanel(self
, -1)
12 button
= wxButton(panel
, 1003, "Close Me")
13 button
.SetPosition(wxPoint(15, 15))
14 EVT_BUTTON(self
, 1003, self
.OnCloseMe
)
15 EVT_CLOSE(self
, self
.OnCloseWindow
)
18 def OnCloseMe(self
, event
):
21 def OnCloseWindow(self
, event
):
24 #---------------------------------------------------------------------------
26 def runTest(frame
, nb
, log
):
27 win
= MyFrame(frame
, -1, "This is a wxFrame", size
=(350, 200),
28 style
= wxDEFAULT_FRAME_STYLE
)# | wxFRAME_TOOL_WINDOW )
33 #---------------------------------------------------------------------------