Thread: Wx Widgets

  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Rep Power

    Wx Widgets

    Plz help me i need to find a good tutorial for wx widgets so i can get to know wx plz i am compleately lost if somone could be kind to help ty (thank you)

  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Rep Power
    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 :

    import wx
    # 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 )
            return 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 !
  4. #3
  5. slightly insane code guru
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2004
    Indianapolis, IN
    Rep Power
    Have you tried Google yet? If you have, disregard this comment.

IMN logo majestic logo threadwatch logo seochat tools logo