Tags: appendtext, calling, programming, python, selected, selection, setselection, textctrl, whenever

TextCtrl Selection Problem

On Programmer » Python

694 words with 0 Comments; publish: Tue, 06 May 2008 23:57:00 GMT; (20078.13, « »)

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.Dialoginit__(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

All Comments

Leave a comment...

  • 0 Comments