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