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?
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)