python - TextCtrl widget crashing in linux -
i using below code snippet, working correctly in windows operating system, when comes linux, closing segmentation fault.
self.textmessage = wx.textctrl(self, -1, '', style=wx.te_multiline|wx.te_readonly) self.hsizer2.add(item=self.textmessage, proportion=1, flag=wx.expand|wx.all, border=3) self.vsizer.add(item=self.hsizer2, proportion=1, flag=wx.expand|wx.all, border=0) self.textmessage.appendtext(message+" \n")
i using redhat enterprise linux. possible replace textctrl widget other widgets , there custom widgets textctrl?
also let me know if miss in above code avoid crash problem
thanks in advance.
i tested code in actual runnable example on kubuntu 14.04 box wxpython 2.8.12 , python 2.7.6 , worked fine. see following example:
import wx ######################################################################## class mypanel(wx.panel): """""" #---------------------------------------------------------------------- def __init__(self, parent): """constructor""" wx.panel.__init__(self, parent) self.vsizer = wx.boxsizer(wx.vertical) self.hsizer2 = wx.boxsizer(wx.horizontal) message = "the bright red fox" self.textmessage = wx.textctrl(self, -1, '', style=wx.te_multiline|wx.te_readonly) self.hsizer2.add(item=self.textmessage, proportion=1, flag=wx.expand|wx.all, border=3) self.vsizer.add(item=self.hsizer2, proportion=1, flag=wx.expand|wx.all, border=0) self.textmessage.appendtext(message+" \n") self.setsizer(self.vsizer) ######################################################################## class myframe(wx.frame): """""" #---------------------------------------------------------------------- def __init__(self): """constructor""" wx.frame.__init__(self, none, title="test") panel = mypanel(self) self.show() if __name__ == "__main__": app = wx.app(false) frame = myframe() app.mainloop()
Comments
Post a Comment