I want to us wxpython for an application that will start its own X11 server. How can do this?
Thanks,
Greg
I want to us wxpython for an application that will start its own X11 server. How can do this?
Thanks,
Greg
Hi. 2.5.2.7 broke my codebase, and I'm having problems figuring out exactly how to handle the repair. I was hoping one of you folks would have some good suggestions.
Traceback (most recent call last):
File "btdownloadgui.py", line 29, in ?
File "BitTornado\ConfigReader.pyc", line 40, in ?
File "wx\_misc.pyc", line 145, in SystemSettings_GetColour
wx._core.PyNoAppError: The wx.App object must be created first!
A section of my code designed to generate, read and write default application settings is generating this error when it tries to read system color settings. It is one of the first functions to be called, long before the GUI comes into the picture. Moving it so it is run after the GUI is initialized would require some major structural changes, and would require changes to the several non-GUI application codings as well, something I'd rather avoid. Can someone recommend the best way to perhaps create a wx.App just to grab the color settings? Hopefully with as little overhead as possible?
John Hoffman wrote:
Hi. 2.5.2.7 broke my codebase,
File "wx\_misc.pyc", line 145, in SystemSettings_GetColour
wx._core.PyNoAppError: The wx.App object must be created first!
yup. this is due to a generally good change that the wx lib does not get initialized on import, but rather on App initialization.
> Can someone recommend the
best way to perhaps create a wx.App just to grab the color settings? Hopefully with as little overhead as possible?
You can put it in your App's OnInit, before any anything else:
class MyApp(wx.App):
def OnInit(self):
DoAllMyInitialization()
frame = MyMainFrame(......)
self.SetTopWindow(frame)
frame.Show()
etc.....
return True
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
I'll assume you're working on BitTornado:
so... try this in btdownloadgui.py:
comment out this import line:
# from BitTornado.ConfigReader import configReader
and where wou declare btWxApp use something like
class btWxApp(wxApp):
def __init__(self, x, params):
self.params = params
wxApp.__init__(self, x)
def OnInit(self):
doneflag = Event()
from BitTornado.ConfigReader import configReader
self.configfile = configReader()
d = DownloadInfoFrame(doneflag, self.configfile)
[...]
it might take care of the problem for now...
On Tue, 05 Oct 2004 10:37:12 -0600, John Hoffman <theshadow@shambala.net> wrote:
Hi. 2.5.2.7 broke my codebase, and I'm having problems figuring out exactly how to handle the repair. I was hoping one of you folks would have some good suggestions.
Traceback (most recent call last):
File "btdownloadgui.py", line 29, in ?
File "BitTornado\ConfigReader.pyc", line 40, in ?
File "wx\_misc.pyc", line 145, in SystemSettings_GetColour
wx._core.PyNoAppError: The wx.App object must be created first!A section of my code designed to generate, read and write default application settings is generating this error when it tries to read system color settings. It is one of the first functions to be called, long before the GUI comes into the picture. Moving it so it is run after the GUI is initialized would require some major structural changes, and would require changes to the several non-GUI application codings as well, something I'd rather avoid. Can someone recommend the best way to perhaps create a wx.App just to grab the color settings? Hopefully with as little overhead as possible?
--
Peter Damoc
Hacker Wannabe