Hy!
I have a problem concerning my implemented GUI, that is the program
sometimes stops and crashes the GUI and closes the windows. I get an error
like this : python: ../../src/xcb_lock.c:77: _XGetXCBBuffer: Assertion
`((int) ((xcb_req) - (dpy->request)) >= 0)' failed.Aborted
Any help is greatly appreciated!
Here is part of the code:
···
#-----------------------------------------------------------------------#
# Class
class Tuner(wx.Frame):
def __init__(self, frame):
wx.Frame.__init__(self, None, -1, "Tunning Stats")
self.frame = frame
self.Stop = False
def StartTune (self):
##########################################
# Frame to display Tunning Evolution
##########################################
self.fftwindow = wx.Frame(self.frame,-1, "Tunning",
style=wx.FRAME_FLOAT_ON_PARENT|wx.CAPTION|wx.CLOSE_BOX,
pos=(200,170), size=(500,500))
fftwindow = self.fftwindow
# Create FFT Plot
self.plot = wx.lib.plot.PlotCanvas(fftwindow, style=wx.RAISED_BORDER)
size = fftwindow.GetClientSize()
self.plot.SetInitialSize(size=size)
self.plot.SetShowScrollbars(False)
self.plot.SetEnableZoom(True)
self.plot.SetFontSizeAxis(point=8)
self.plot.SetFontSizeTitle(point=15)
self.winSizer = wx.BoxSizer(wx.VERTICAL)
self.winSizer.AddSpacer(20)
self.winSizer.Add(self.plot)
self.winSizer.AddSpacer(20)
self.SetSizer(self.winSizer)
fftwindow.Fit()
fftwindow.Show()
# Just some work...
while(1):
if self.Stop:
time.sleep(2)
print "stop1"
fftwindow.Close()
print "stop2"
print "stop3"
return
for i in range(100): print i
for i in range(100): print 100-i
#the above prints are just for simulating a process.
def StopTune(self):
self.Stop = True
#---------------------------------------------------------------------------------------------#
# GUI
(....)
#TUNNING INTERFACE
# Prepare to Start Tunning
def OnTune(self,event):
self.TuneButton.Enable(False)
self.StopButton.Enable(True)
self.SetStatusText("Tunning...")
self.t = Tuner.Tuner(self)
self.thread = threading.Thread(target=self.__run)
self.thread.setDaemon(True)
self.thread.start()
# Start Tunnning
def __run(self):
wx.CallAfter(self.AfterRun)
self.t.StartTune()
self.SetStatusText("Tunning Complete...")
# Free GUI
def AfterRun(self):
pass
# Stop Tuner
def OnStop(self, event):
self.t.StopTune()
self.TuneButton.Enable(True)
self.StopButton.Enable(False)
print "Stoped!"
(.....)
--
View this message in context: http://www.nabble.com/GUI-crashing-problem-help-tp23503108p23503108.html
Sent from the wxPython-users mailing list archive at Nabble.com.