[Pythonmac-SIG] wxPython book. First example misbehaves on my Mac ?? What's happening?

Louis Pecora pecora at anvil.nrl.navy.mil
Mon Apr 10 21:11:10 CEST 2006


I just got the wxPython in Action book (Rappin and Dunn).  Looks good.  
I've been fooling around with the first two (very trivial) examples, but 
their behavior is not what is expected.  They run, a window (frame) 
opens, but then immediately closes and the application quits.  No 
errors.  Just "normal" termination.  I've run it from BBEdit and from 
the command line.  Same thing each way.  I expected the window to stay 
open until I clicked the close button.  Anyone have a clue for me? (it's 
gotta be something easy I'm missing).  I'm running Python 2.4.1.

Here's the code (9 lines):

#!/usr/bin/pythonw

import wx

class App(wx.App):
    def OnInit(self):
        frame = wx.Frame(parent=None, title="BaRe")
        frame.Show()
        return true

app = App()
app.MainLoop()


-- 
Cheers,

Lou Pecora

Code 6362
Naval Research Lab
Washington, DC  20375
USA
Ph:  +202-767-6002
email:  pecora at anvil.nrl.navy.mil



More information about the Pythonmac-SIG mailing list