[wxPython] Sizing a wxListCtrl on a Panel

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] Sizing a wxListCtrl on a Panel

Jethro Cramp
I have a wxListCtrl on a panel that is itself the top half of a horizontal
split on a frame.
The problem is that the list ctrl is only as wide as the columns and only
one row high. I would like the ListCtrl to size automatically to fill the
panel, similar to the way it works on the notebook in demo.py

I have played around with SetDimensions and can make the ListCtrl specific
sizes but I can't get it to work the way I would like. Any suggestions?

TIA,

Jethro Cramp

[hidden email]

(BTW Thanks Robin & Gary for the Demo. I wouldn't be able to even begin
learning wxPython without it!)


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Sizing a wxListCtrl on a Panel

Robin Dunn
> I have a wxListCtrl on a panel that is itself the top half of a horizontal
> split on a frame.
> The problem is that the list ctrl is only as wide as the columns and only
> one row high. I would like the ListCtrl to size automatically to fill the
> panel, similar to the way it works on the notebook in demo.py
>
> I have played around with SetDimensions and can make the ListCtrl specific
> sizes but I can't get it to work the way I would like. Any suggestions?
>

Brute Force: Provide an EVT_SIZE event handler for the panel.  When the panel
is resized, chage the size of the list control.  For single child windows
this is probably the easiest.

Sizer or Constraint:  Use a sizer or layout constraints to automatically
resize the list control when the panel changes size.  See the demo for
examples.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!







_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users