[wxPython-users] adding controls to ListCtrl cells (or similar?)

Josiah Carlson jcarlson at uci.edu
Thu Nov 2 08:58:21 PST 2006


Tyler Retzlaff <rtr at omicron-persei-8.net> wrote:
> Good Day,
> 
> Could someone tell me which widgets I would use to achieve something
> similar to the following.
> 
> Basically I would like to put controls (e.g. Gauge) inside ListCtrl  
> cells.  Of
> course you cannot do this with a ListCtrl so what is the appropriate  
> widget?
> If there isn't one what widget would folks recommend that I extend?
> Though I would like to use only pure python in such an extension.

It depends on what you want to do.  wx.Grid allows you to draw anything
on a cell, so you can draw your gauge directly.  I have personally used
percent displays with color changes on list controls for the entire cell
and have been fairly happy.  You could also use one of the grid sizers 
(GridBagSizer, FlexGridSizer) and embed all of your controls directly. 
If you are trying for some firefox-download-like list of rows, etc., you
could create a custom row object, and use a wx.BoxSizer(wx.VERTICAL) to
lay out their orientation relative to each other.

 - Josiah





More information about the wxpython-users mailing list