[Tutor] wxPython crash

BELSEY, Dylan dylan.belsey@baesystems.com
Fri, 23 Aug 2002 09:44:13 +0930


	Not familiar with wxPython but you may want to try putting the code
in a script file and run from the prompt (you may already be doing this!).
This will usually make visual any errors that are occurring.  I don't
understand why you need to pass "0" to the MyApp class as it appears that
its initialisation function does not accept any outside
parameters....suggest trying:
app = MyApp() # Without the zero

   ..... and see how you go.  Having not seen the example in context, I may
be completely off target here, but I hope this helps.
		Dylan




-----Original Message-----
From: Terje Johan Abrahamsen [mailto:terjeja@hotmail.com]
Sent: Friday, 23 August 2002 04:26
To: tutor@python.org
Subject: [Tutor] wxPython crash


I have installed the wxPython with my Activestate Python. Then I look in the

documentation to learn it. When I try the first example:

from wxPython.wx import *

class MyApp(wxApp):
    def OnInit(self):
        frame = wxFrame(NULL, -1, "Hello from wxPython")
        frame.Show(true)
        self.SetTopWindow(frame)
        return true

app = MyApp(0)
app.MainLoop()

Python just closes. No warnings, no errors, no nothing. It just closes. 
However, if I remove the "app = MyApp(0)" line, I get just an exception 
raised, so I assume that that must be where the problem is. What can this be

caused by?

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor