A bonus during the recent deployment of several hundred copies of an
application entirely rewritten in Python and using wxPython, was having
unexpected errors pop up in a redirected stdio window. In my own defence,
these were mainly caused while importing strange, and invalid values from
the "database" maintained by the old application. But it was a doddle to
fetch the contents of the error window into a user-generated report that
could be emailed back.
I made some minor changes to, what is now _core.py (Version:
2.5.2.2p.20040629), to allow the title, size and position of the error
window to be set when initialising wx.App, and the attached diff file
shows them applied to wxpython/src/_app_ex.py which, I think, is used to
create _core.py automatically. I am not able to create _core.py myself to
test these, so the file could contain transcription errors in copying the
changes from my own copy of _core.
I would like to submit these for inclusion in wxPython.
I made some minor changes to, what is now _core.py (Version: 2.5.2.2p.20040629), to allow the title, size and position of the error window to be set when initialising wx.App, and the attached diff file shows them applied to wxpython/src/_app_ex.py which, I think, is used to create _core.py automatically. I am not able to create _core.py myself to test these, so the file could contain transcription errors in copying the changes from my own copy of _core.
I would like to submit these for inclusion in wxPython.
Another way this could be done is to use a custom output window class, like this:
class MyApp(wx.App):
outputWindowClass = MyOutputClass
def OnInit(self):
...
But your approach is a good idea too, so I am going to apply parts of it. Instead of passing the extra parameters in wx.App's __init__ I think I'll do it in a separate method. That way the other app classes won't also need to be updated.
ยทยทยท
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
> I made minor changes to .. allow the title, size and position of the
> error window to be set when initialising wx.App...
... I am going to apply parts of
it. Instead of passing the extra parameters in wx.App's __init__ I
think I'll do it in a separate method. That way the other app classes
won't also need to be updated.
Many thanks for the new App.SetOutputWindowAttributes method. It's a much
cleaner way than my original suggestion. It works just fine, once I'd
figured it needs to be called right at the start of OnInit().
Regards,
David Hughes
Forestfield Software
www.foresoft.co.uk