Hello:
In my application, the frame is shown, but the wxTextCtrl is not. I would like to know what’s wrong on my code.
I’m using wxPython 2.3 hybrid with Python 2.2 on a Windows 98 SE box.
Thanks in addvance, Fernando.
from wxPython.wx import *
class MyFrame(wxFrame):
def init(self,parent,ID,title):
wxFrame.init(self,parent,ID,title, wxPoint(50,50),wxSize(200,200))
panel=wxPanel(self,-1)
self.theText=wxTextCtrl(panel,-1,“This is the wxTextCtrl.”,
wxDLG_PNT(panel,wxDefaultPosition),
wxDLG_SZE(panel, wxDefaultSize),
wxTE_MULTILINE|wxTE_RICH)
self.panel=panel
self.panel.Show(true)
def OnQuit(self):
self.Close(true)
class MyApp(wxApp):
def OnInit(self):
frame=MyFrame(NULL,-1,“This is my frame”)
self.SetTopWindow(frame)
frame.Show(true)
return true
#----------Create an instance of MyApp---------------------------------------
app=MyApp(0)
app.MainLoop() #handle all events
···
#-------------------------------------------------------------------------------