class CAP_GUI(wx.Dialog):
def __init__(self,out,cap_file,name=''):
self.out=out
par=wx.Dialog.__init__(self, None, 134, 'Enter '+name+' capatcha', size=(190, 180),style=wx.CAPTION)
wx.Button(self, 1, 'Close', (10,120))
wx.Button(self, 2, 'Ok', (100, 120))
jpg1 = wx.Image(cap_file, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
wx.StaticBitmap(self, -1, jpg1, pos=(10, 5), size=(jpg1.GetWidth(), jpg1.GetHeight()))
self.capentr = wx.TextCtrl(self, -1,pos=(10,90),size=(150,-1))
self.Bind(wx.EVT_BUTTON, self.OnClose, id=1)
self.Bind(wx.EVT_BUTTON, self.Apply, id=2)
self.Centre()
self.Show(True)
def Apply(self,event):
self.out.cap_val=self.capentr.GetValue()
def OnClose(self,Event):
self.out.cap_val=''
self.Close(True)
wx._core.PyAssertionError: C++ assertion “wxThread::IsMain()” failed at ..\..\src\common\timercmn.cpp(66) in wxTimerBase::Start(): timer can only be started from the main thread
что делать,?