Robert Oeffner wrote:
Hi all,
Forgive me if this has been asked before. But is it possible to control
the size of a child window item in a HyperTreeList control by adding it
to a wx.Sizer?
I'd like to size a push button with a label and then attach it as a
child item window with HyperTreeList.SetItemWindow(). What I tried was:mpanel = wx.Panel(myhypertree)
mysizer = wx.BoxSizer(wx.VERTICAL)
mysizer.Add(mybutton, 0,0,0)
mpanel.SetSizer(sizer)
myhypertree.SetItemWindow(mytreelistitem, mysizer, 0)but the panel was placed at coordinates (0,0) of the hypertreelist
control and the button was not resized to best fit of its label. If
anyone can point me in the right direction I'd be grateful.
Sizers are not windows, so you can't pass them as parameters where a window is expected. On top of that, I don't think the HTL class manages the size of item windows at all, so it is up to you to make them the size you want them to be. If a widget has a meaningful best size then it may be as simple as widget.SetSize(widget.GetBestSize())
···
--
Robin Dunn
Software Craftsman