I have a text (with several lines) that I need to put in a wxPython TextCtrl.
The problem is that some of these lines are with unprintable characters.
My solution to that was to use AppendText, and try-catch the problematic line.
The current problem is that for a large number of lines it takes a lot of time (relative to preparing a large string with all the lines and using SetValue)
Is there a way to append lines of text to TextCtrl “silently” (so it will not redraw after each line)?
Since wxTextCtrl derives from wxWindow, it inherits its Freeze() and Thaw() methods.
Freeze()will lock screen updates for the control, andThaw()will re-enable them. The documentation actually mentions your very use case, albeit with a caveat: