]>
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
, size
):
8 wxFrame
.__init
__(self
, parent
, ID
, title
, pos
, size
)
9 panel
= wxPanel(self
, -1)
11 button
= wxButton(panel
, 1003, "Close Me")
12 button
.SetPosition(wxPoint(15, 15))
13 EVT_BUTTON(self
, 1003, self
.OnCloseMe
)
14 EVT_CLOSE(self
, self
.OnCloseWindow
)
17 def OnCloseMe(self
, event
):
20 def OnCloseWindow(self
, event
):
23 #---------------------------------------------------------------------------
25 def runTest(frame
, nb
, log
):
26 win
= MyFrame(frame
, -1, "This is a wxFrame", wxDefaultPosition
, wxSize(350, 200))
31 #---------------------------------------------------------------------------