Size of controls inside a Panel

Hello all,

Let's suppose I have a panel and I put inside it a
TreeCtrl. I want the TreeCtrl to always be as large as
the parent panel so I am placing it inside a box sizer
which resizes the TreeCtrl to full size always.
If I don't use the sizer the TreeCtrl has a fixed
size.
Is there a way to add a control to a panel and the
control always ocupy the whole panel wihout using a
sizer?

Thanks,
soso

···

__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25�
http://photos.yahoo.com/ph/print_splash

Sorin C. wrote:

Hello all,

Let's suppose I have a panel and I put inside it a
TreeCtrl. I want the TreeCtrl to always be as large as
the parent panel so I am placing it inside a box sizer
which resizes the TreeCtrl to full size always. If I don't use the sizer the TreeCtrl has a fixed
size.
Is there a way to add a control to a panel and the
control always ocupy the whole panel wihout using a
sizer?

Handle the panel's EVT_SIZE yourself, something like this:

class MyPanel(wx.Panel):
  def __init__(self, parent, ID=-1, pos=wx.DefaultPosition,
    size=wx.DefaultSize, style=0, name="FullChildPanel"):
    wx.Panel.__init__(self, parent, IS, pos, size, style, name)
    self.child = # make child window here
    self.Bind(wx.EVT_SIZE, self.OnSize)

  def OnSize(self, evt):
    self.child.SetSize(self.GetSize)

···

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