Вот код:
import wx
import wx.richtext as richtext
class RichTextEditor (wx.Panel):
def __init__ (self, *args, **kwargs):
wx.Panel.__init__(self, *args, **kwargs)
self.rt = richtext.RichTextCtrl(self, wx.ID_ANY, style = richtext.RE_MULTILINE)
self.__do_layout()
def __do_layout (self):
sizer_main = wx.BoxSizer(wx.HORIZONTAL)
self.SetSizer(sizer_main)
sizer_main.Add(self.rt, 1, wx.EXPAND,0)
class TestFrame (wx.Frame):
def __init__ (self):
wx.Frame.__init__(self, None, wx.ID_ANY, "Application", size=(400, 300))
self.rte = RichTextEditor(self, wx.ID_ANY)
self.Show()
if __name__ == "__main__":
app = wx.App()
frame = TestFrame()
app.SetTopWindow(frame)
app.MainLoop()
Что я делаю не так? :rolleyes: