I’m having a small problem with the TextCtrl, whenever
I AppendText() everything in the TextCtrl is selected. I tried calling
SetSelection(0, 0) to deslect the text, but nothing happened. Any ideas?
import wx
class test(wx.Dialog):
def __init__(self):
wx.Dialog.__init__(self, None, -1,
“testing”)
text = wx.TextCtrl(self, -1,
style=wx.TE_MULTILINE)
text.AppendText("aaaa\nbbbbbb\nvcccccc\nddddd\n\n\n\n")
sizer = wx.BoxSizer()
sizer.Add(text, 1, wx.EXPAND)
self.SetSizer(sizer)
self.Center()
self.Show()
app = wx.App(0)
f = test()
app.MainLoop()
-Kyle Rickey