0

Hi have a StyledTextCtrl log window in which I only want to write text to via python, and NOT be able to type on the keyboard to enter text onto in manually. When I use SetEditable(False) this locks the whole window, so python can't write to the window as well. How do I get it so python can write to it but I can't?

self.running_log1 = wx.stc.StyledTextCtrl(self, pos=(5, 5), size=(575,505))
self.running_log1.SetMarginWidth(1, 0)
self.running_log1.SetEditable(False)

----------------------------

self.running_log1.AppendText(line)
speedyrazor
  • 3,127
  • 7
  • 33
  • 51

1 Answers1

0

I had the same problem. Not sure if this is the proper way to do this, but the way I got round it was to set editable to true before appending and then set editable to false after appending. So in your example, the code would look like this:

self.running_log1 = wx.stc.StyledTextCtrl(self, pos=(5, 5), size=(575,505))
self.running_log1.SetMarginWidth(1, 0)
self.running_log1.SetEditable(False)

----------------------------

self.running_log1.SetEditable(True)
self.running_log1.AppendText(line)
self.running_log1.SetEditable(False)
Lucas
  • 41
  • 5