]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/tests/testDlg.py
1 ## import all of the wxPython GUI package
2 from wxPython
.wx
import *
5 ## Create a new frame class, derived from the wxPython Frame.
6 class Dialog(wxDialog
):
8 def __init__(self
, parent
, title
):
9 # First, call the base class' __init__ method to create the frame
10 wxDialog
.__init
__( self
, parent
, -1, title
, wxDefaultPosition
, wxDefaultSize
)
12 wxButton(self
, wxID_OK
, "OK", (10, 10))
13 wxButton(self
, wxID_CANCEL
, "Cancel", (50,50))
17 # This method is called automatically when the CLOSE event is
19 #def OnCloseWindow(self, event):
22 #def OnCloseMe(self, event):
27 # Every wxWindows application must have a class derived from wxApp
30 # wxWindows calls this method to initialize the application
33 # Create an instance of our customized Frame class
34 dialog
= Dialog( NULL
, 'test' )
39 # Tell wxWindows that this is our main window
40 # Return a success flag
43 app
= App(0) # Create an instance of the application class
44 app
.MainLoop() # Tell it to start processing events
48 if __name__
== '__main__':