1

I would like to add text or a char to my StyledTextCtrl in a specific position. for example add the char 'a' after the position 52 (after 52 chars).

import wx
from wx.stc import StyledTextCtrl

app = wx.App()
frame = wx.Frame(None, -1, title='2', pos=(0, 0), size=(500, 500))
frame.Show(True)
messageTxt = StyledTextCtrl(frame, id=wx.ID_ANY, pos=(0, 0), size=(100 * 3, 100),
                            style=wx.TE_MULTILINE, name="File")

app.SetTopWindow(frame)
app.MainLoop()
Yuval Sharon
  • 159
  • 8
  • You mean `Add` not `Append`. Use `SetCurrentPos(pos)` but be aware that text must exist at that position or the text is `appended` at the last position with an existing character. – Rolf of Saxony Nov 23 '19 at 09:44
  • There is any different between SetCurrentPos() to SetInsertionPoint()? @RolfofSaxony – Yuval Sharon Nov 23 '19 at 11:51

0 Answers0