[Pythonmac-SIG] wx Window Flashes and Closes Immediately

Bryan Smith bryanabsmith at gmail.com
Mon Feb 2 06:02:34 CET 2009


Oh my, I feel kind of dumb. I can't believe I spent time stewing over that.
Thanks!

On Sun, Feb 1, 2009 at 11:50 PM, Cody Precord <codyprecord at gmail.com> wrote:

> Hello,
>
> On Feb 1, 2009, at 10:42 PM, 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()
>>
>>
> Should be mainFrame.Show() <- UPPER case S.
>
> To see the traceback of errors you should create the app object with
> wx.App(False) to disable redirection of output, so tracebacks will be
> printed to the console.
>
>
> Cody
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20090202/e3eec7fc/attachment.htm>


More information about the Pythonmac-SIG mailing list