November 5th, 2004, 10:39 AM
Join Date: Jul 2003
Time spent in forums: 1 Day 47 m 5 sec
Reputation Power: 14
I don't know any good tutorial on wxWidgets but you should have a look at the small sample applications that come with the wxPython distribution. Personnaly, that's the way I learnt to use wxWidgets.
Anyway, here is a basic example :
# We need to define a class representing the application
# by deriving the wxApp class
class MyApp( wx.App ) :
def OnInit( self ) :
""" This method specifies what has to be done
when the application is started. Here, we'd
like to open the main window of our application.
This method has to return True to indicate that
the initialisation process succeeded.
frame = MainFrame( None, # No parent
-1, # Window's ID
"MyApp" ) # Window's title
self.SetTopWindow( frame )
frame.Show( True )
# Here, we'll define our own main window class by
# inheriting the wxFrame class.
class MainFrame( wx.Frame ) :
def __init__( self, parent, id, title ) :
wx.Frame.__init__( self, parent, id, title )
if __name__ == "__main__" :
# To run the application, we now need to instanciate
# the application class and call its MainLoop() method
Good luck !