How can i span rows and colums in wxpython BoxSizer

Hello i am trying to creating a simple very simple application, but as i see
how iam going to go about every thing, i find the problem. There is a
wxTexCtrl that needs to spann some colums. but when i extende it's size the
other also changes position as you can see in the photo below.
http://wxpython-users.1045709.n5.nabble.com/file/n5713851/Help.png

How can a span it with out the other extending or without interfering with
othrer witdges

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/How-can-i-span-rows-and-colums-in-wxpython-BoxSizer-tp5713851.html
Sent from the wxPython-users mailing list archive at Nabble.com.

BoxSizer’s don’t have columns. Perhaps you were referring to a GridSizer, GridBagSizer or similar? I have a tutorial on the latter: wxPython Sizers Tutorial: Using a GridBagSizer - Mouse Vs Python

There are also these links that may help you:

http://wiki.wxpython.org/SizerTutorials

If you meant that you want your widgets to stretch within a BoxSizer, then you’ll need to do something like this:

mySizer.Add(widget, proportion=1, flag=wx.EXPAND)

  • Mike
···

On Thursday, July 5, 2012 6:08:00 AM UTC-5, want_learn1 wrote:

Hello i am trying to creating a simple very simple application, but as i see

how iam going to go about every thing, i find the problem. There is a

wxTexCtrl that needs to spann some colums. but when i extende it’s size the

other also changes position as you can see in the photo below.

http://wxpython-users.1045709.n5.nabble.com/file/n5713851/Help.png

How can a span it with out the other extending or without interfering with

othrer witdges

import wx

class Simple(wx.Frame):

def init(self):

wx.Frame.init(self, None, -1, “”, size=(400,200))

#creating the panel

self.panel = wx.Panel(self, -1)

#creating the static text

self.nick_name = wx.StaticText(self.panel, -1, “Nickname:”)

self.nick_win = wx.TextCtrl(self.panel, -1, “nickwin”, size=(150,30))

self.status_win = wx.TextCtrl(self.panel, 0, “This is the one”,

size=(180,60),style=wx.TE_MULTILINE)

self.msg_text = wx.StaticText(self.panel, -1, " Message:")

self.msg_win = wx.TextCtrl(self.panel, -1, “msg”, size=(150,30))

gbs = wx.GridBagSizer(5,5)

gbs.Add(self.nick_name, (0,0), (1,1), wx.ALIGN_CENTER_VERTICAL)

gbs.Add(self.msg_text, (1,0), (1,1), wx.ALIGN_CENTER_VERTICAL)

gbs.Add(self.nick_win, (0,1), (1,1))

gbs.Add(self.msg_win, (1,1), (1,1))

sizer = wx.BoxSizer(wx.HORIZONTAL)

sizer.Add( gbs, 0, wx.TOP | wx.BOTTOM | wx.LEFT, 5)

sizer.Add( self.status_win, 1, wx.ALL | wx.EXPAND, 5)

#making the panel lay out of widgest

self.panel.SetSizer(sizer)

self.panel.Fit()

self.SetMinSize( self.GetSize() )

#self.panel.Layout() #starting the layout

if name==‘main’:

app = wx.PySimpleApp()

frame = Simple()

frame.Show()

app.MainLoop()