Hi all,
I have a stc.StyledTextCtrl that I’m using as a log in an application.
This log is continuously updated with appended text. However, because this text will never stop, I’m concerned about memory use so I would like to put a line limit on the display if possible. I’m not sure if there’s a way to set this, or if I have to manually issue commands to remove text from the beginning. I either case I can’t really seem to get anywhere at the moment. How would you go about this?
NB: I also posted about this here: http://forums.wxwidgets.org/viewtopic.php?f=27&t=37748
···
–
Luke
Also, I’ve tried to use the DeleteRange method as documented here:
http://wxpython.org/Phoenix/docs/html/stc.StyledTextCtrl.html#stc.StyledTextCtrl.DeleteRange
But an exception is thrown saying there is no such member function for StyledTextCtrl 
Hi,
you may try the Remove(...) method:
http://wxpython.org/Phoenix/docs/html/stc.StyledTextCtrl.html#stc.StyledTextCtrl.Remove
the mentioned documentation refers to the development version of
wxpython (Phoenix) and there might be some mismatches between the
versions.
Remove() does exist in wxpython 2.9.4 (end presumably in older
versions as well) and seems to do, what you are asking.
What is the size of the log data, you are collecting? In my limited
experience stc can cope with larger texts rather well (e.g. comparing
to wx.TextCtrl), but of course, there will be some practical limits as
well.
hth,
vbr
···
2013/7/24 Luke Whitehorn <luke.whitehorn@gmail.com>:
Also, I've tried to use the DeleteRange method as documented here:
http://wxpython.org/Phoenix/docs/html/stc.StyledTextCtrl.html#stc.StyledTextCtrl.DeleteRange
But an exception is thrown saying there is no such member function for
StyledTextCtrl 
--