[wxPython-users] Multiline TextCTRL won't span

Robin Dunn robin at alldunn.com
Mon Mar 26 10:58:29 PDT 2007


Lucas wrote:
> Hi,
> For some reason, I can't span a textctrl in a gridbag sizer.
> Here is my code:
> 
> self.status = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_MULTILINE|wx.TE_READONLY)
> self.sizer.Add(self.status,(2,0),(2,4))
> print self.sizer.GetItemSpan(self.status)#returns (2,4)
> 
> Any ideas?

Pass the wx.EXPAND flag to the Add method.  What you have above tells 
the sizer to give the widget all the space in those cells, but it 
doesn't tell it how to size/position the widget within that space.  So 
it just leaves the widget at its default size and aligns it to the top 
left by default.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list