trying to get layout contraints working, i want the wxTectCtrl to fit the size of the window. i tried copying stuff from the demo, but it doesnt work - i get the same effect as i would without.
reading up on layout techniques, layout constraints sounds to me like what i need. but i cant get it working :/.
if its relavent, im using python 2.2.2 and wxpython 2.3.3.1 - any help would be appreciated.
from wxPython.wx import *
class MyFrame(wxFrame):
def __init__(self, parent, id, title):
wxFrame.__init__(self, parent, id, title,
wxPoint(100, 100), wxSize(500, 400))
EVT_CLOSE(self, self.OnCloseWindow)
self.textWindow = wxTextCtrl(self.panel, -1, "", style=wxTE_MULTILINE)
cons = wxLayoutConstraints()
cons.top.SameAs(self.panel, wxTop)
cons.right.SameAs(self.panel, wxRight)
cons.width.PercentOf(self.panel, wxWidth, 100)
cons.height.PercentOf(self.panel, wxHeight, 100)
self.textWindow.SetConstraints(cons)
self.panel = wxPanel(self, -1)
def OnCloseWindow(self, event):
self.Destroy()
class MyApp(wxApp):
def OnInit(self):
self.frame = MyFrame(None, -1, "TITLE")
self.frame.Show(true)
self.frame.size = (10, 10)
self.SetTopWindow(self.frame)
return true
app = MyApp(0)
app.MainLoop()