Beremiz.py
changeset 1564 8ffd0b52c2c7
parent 1560 4ce8492159ab
child 1565 894f31f8ca64
--- a/Beremiz.py	Tue Nov 08 18:06:30 2016 +0300
+++ b/Beremiz.py	Tue Nov 08 18:14:30 2016 +0300
@@ -248,12 +248,14 @@
                 # adding text. It seems that text modifications, even
                 # programmatically, are disabled in StyledTextCtrl when read
                 # only is active
+                start_pos = self.output.GetLength()
                 self.output.SetReadOnly(False)
                 self.output.AppendText(s)
                 self.output.SetReadOnly(True)
+                text_len = self.output.GetLength() - start_pos
 
                 if style != self.black_white:
-                    self.output.SetStyling(len(s), style)
+                    self.output.SetStyling(text_len, style)
             self.stack = []
             self.lock.release()
             self.output.Thaw()