Bryan Smith wrote:
Hi Everyone,

I am trying out a simple wx program from a book and anytime I try and run the code, the wxFrame flashes open and closes immediately. This is frustrating as the code is essentially the same as in the book. Here is the code for your viewing pleasure:

import wx

class wxTest():
def __init__(self):
        mainApp = wx.App()
mainFrame = wx.Frame(None)
        mainButton = wx.Button(mainFrame)
        mainFrame.show()
mainApp.MainLoop() if __name__ == "__main__":
    w = wxTest()

What am I missing here?

Show is spelled with a capital S. If you pass redirect=False to the wx.App constructor then you'll be better able to see any problems that happen in the initialization code.


--
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to