I have a program where several threads are writing to a logging class,
and from there the logging class uses a callback to display the
information in one of several notebook windows. This works great under
windows. However, when I try it under linux (rh 7.3), the program locks
up, sometimes segfaults, and generally makes X unhappy.
Not setting the callback clears everything up, so it seems to be a
wxProblem, but I could just be out of my mind.
I'll include some code snippets:
From the logger class:
def logPacR(self, msg, pac = 0):
self.logcon.acquire()
tmsg = prefix() + "<<"+msg + "\n"
self.paclog[pac] = self.paclog[pac] + tmsg
self.pacfile[pac].write(tmsg)
self.pacfile[pac].flush()
self.logcon.release()
try:
self.paccallbk[pac][1](self.paccallbk[pac][0], tmsg, pac)
except:
pass
From the gui class:
from init:
self.logtxt = wxTextCtrl(self.nb, -1,
style =
wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL)
self.nb.AddPage(self.logtxt, "Event Log")
self.logtxt.AppendText("Starting CEServ\n")
self.log.setEvtOutput(self, self.evtCallbk)
and the call back:
def evtCallbk(self, obj, msg):
obj.logtxt.AppendText(msg)
Thanks,
Ron
···
--
Ron Alford, KB0NUV
-----------------------------------------------------
System hosed. Would you like to continue? [Y]: