
May 7th, 2004, 01:29 PM
|
|
Contributing User
|
|
Join Date: Feb 2004
Location: London, England
|
|
You can do this quite easily using sizers.
I generally use wxGlade to design GUIs like this - it will let you play around with the layout and try out different options. It took me a couple of minutes to get it to generate the following:
Code:
#!/usr/bin/env python
# generated by wxGlade 0.3.2 on Fri May 07 19:28:38 2004
import wx
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.text_ctrl_1 = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE)
self.text_ctrl_2 = wx.TextCtrl(self, -1, "")
self.__set_properties()
self.__do_layout()
# end wxGlade
def __set_properties(self):
# begin wxGlade: MyFrame.__set_properties
self.SetTitle("frame_1")
self.text_ctrl_1.SetSize((392, 300))
# end wxGlade
def __do_layout(self):
# begin wxGlade: MyFrame.__do_layout
sizer_1 = wx.BoxSizer(wx.VERTICAL)
sizer_1.Add(self.text_ctrl_1, 0, wx.EXPAND, 0)
sizer_1.Add(self.text_ctrl_2, 0, wx.EXPAND, 0)
self.SetAutoLayout(1)
self.SetSizer(sizer_1)
sizer_1.Fit(self)
sizer_1.SetSizeHints(self)
self.Layout()
# end wxGlade
# end of class MyFrame
Dave - The Developers' Coach
|