1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| #!/usr/bin/env python
# _*_ coding: utf-8 _*_
import wx
class TextctrlExampleFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title)
panel = wx.Panel(self)
textCtrl1 = wx.TextCtrl(panel)
textCtrl2 = wx.TextCtrl(panel)
Box = wx.BoxSizer(wx.VERTICAL)
Box.Add(textCtrl1,1,wx.EXPAND)
Box.Add(textCtrl2,1,wx.EXPAND)
panel.SetSizer(Box)
text1 = "test".join(chr(i) for i in [0x01,0x31,0x69,0x69])
text2 = "test".join(chr(i) for i in [0x01,0x31,0x00,0x69])
textCtrl1.AppendText(text1)
textCtrl2.AppendText(text2)
self.Show()
if __name__ == '__main__':
import traceback
try:
app = wx.PySimpleApp(redirect=True)
frm = TextctrlExampleFrame(None, "TextCtrl Example")
app.MainLoop()
except:
traceback.print_exc (file=open('error.txt', 'w')) |
Partager