[wxPython] wxTextCtrl and long texts

Thanks to Ken and Dan for their useful help.

Now I have another problem; using the example Dan suggested (or even mine),
I have found out that wxTextCtrl cannot handle long texts.
Since I am trying to write a simple program to count letters from a .txt
file, I would like to test it with long texts (around 300 Kb or more), but
whenever I try to load one, it doesn't work and the text is either truncated
or no text at all appears in the window.

Is there any way to override this problem ?

The code (Dan version) is as follows:

···

#------------------------------------------------------

from wxPython.wx import *

class MyFrame(wxFrame):

    def __init__(self, parent, ID, title, text):
        wxFrame.__init__(self, parent, ID, title,
                         wxDefaultPosition, wxSize(400, 300))

        fintesto = wxTextCtrl(self, 30, text, wxPoint(80, 75), wxSize(200,
150), wxTE_MULTILINE)

class MyApp(wxApp):
    def OnInit(self):

        file=open ( 'testo.txt','r')
        text=file.read()
        file.close()

        frame = MyFrame(NULL, -1,'', text)
        frame.Show(true)
        self.SetTopWindow(frame)
        return true

app = MyApp(0)
app.MainLoop()

#----------------------------------------------

Thanks in advance.

Fabrizio C.

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Now I have another problem; using the example Dan suggested (or even mine),
I have found out that wxTextCtrl cannot handle long texts.
Since I am trying to write a simple program to count letters from a .txt
file, I would like to test it with long texts (around 300 Kb or more), but
whenever I try to load one, it doesn't work and the text is either truncated
or no text at all appears in the window.

Is there any way to override this problem ?

On Windows you need to use the wxTE_RICH style flag to indicate that the native RichEdit control should be used. It has no 64k limit like the default control does.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users