It seems like a simple problem but I can't seem to find the solution. Basically I have a wx.TextCtrl on a wx.ScrolledWindow and I want to expand the TextCtrl to fill the window - a simple editor if you will.
I have the "Proportion" as "1" and I've used a sizer and tried different "Layouts" but nothing works.
Not only that but I want to expand scroll bars at will and see the whole rectangle change at will. MS-Notepad does exactly what I want it to do. The code is below. (13 lines) Any ideas?
RR
import wx
class ScrollbarFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'Scrollbar Example',
size=(300, 200))
sizer = wx.BoxSizer()
self.scroll = wx.ScrolledWindow(self, -1)
self.scroll.SetScrollbars(1, 1, 1000, 1000)
self.scratch = wx.TextCtrl(self.scroll, -1, style=wx.TE_MULTILINE|wx.ALL|wx.TE_RICH2)
sizer.Add(self.scratch, 1, wx.ALL|wx.EXPAND|wx.ALIGN_RIGHT|wx.ADJUST_MINSIZE, 0)
self.scratch.SetEditable(True)
self.SetBackgroundColour(wx.WHITE) # Sets canvas to WHITE (from grey)
self.scratch.SetFocus()
#self.SetAutoLayout(True) # None of these seemed to work as I'd hoped
#self.SetSizer(sizer_1)
#sizer_1.Fit(self)
#sizer_1.SetSizeHints(self)
#self.Fit()
#self.Layout()
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = ScrollbarFrame()
frame.Show()
app.MainLoop()