wx.TextCtrl 30000 limit workaround needed - or an alternate control to use.

I'm using Python 2.4.3 and wxPython 2.6.3.3 and I'm trying to display the
contents of a 2MB file in a TextCtrl.

Are you sure that's what you want? 2 megs of text is quite a bit...

I've found one or two posts that describe a 30000 byte limit on what can be
displayed in this control - is there any way to work around this limit to
display all the contents or is there another control that is better suited?

Try the wx.TE_RICH or wx.TE_RICH2 style. It should allow for larger
documents to be displayed on Windows. Linux and OSX shouldn't have the
length limit and will ignore the styles.

I've tried using the wx.html.HtmlWindow and while it displays all the
contents it doesn't seem to preserve the line endings - I expect this with
an html control though.

text.replace('\n', '<br>')

Or even use this recipe:
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440563

Specifically...

    T.pre(text).render()

It will handle escaping of all necessary html/xml identities, and would
even give you a fixed width font, if that's what you want.

- Josiah

ยทยทยท

"Chris Braithwaite" <chrisbrat@gmail.com> wrote: