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

Tyler Retzlaff rtr at omicron-persei-8.net
Tue Nov 7 21:16:00 PST 2006


Hi Josiah,

thank you for your earlier reply.

I am trying to do something similar to the firefox download layout  
but with some
elements custom to my application.

 From your comments it would appear that I am best off using the  
wx.grid.Grid
control to achieve what I want.

I used the gauge as a simple example but ideally I want to put a  
panel in the
cell (thus allowing me to stuff and layout anything I want within the  
cell).  This
being the case is drawing the panel on the cell really my best  
option?  Or am
I better off creating a custom row,  I suspect the later because I  
would like the
cell to automatically resize based on the control(s) I place in it.

I've been reading the wxpython online docs and the wiki but I'm must be
missing the example that describes how to create and add a custom row
object to a wx.grid.Grid.  I did find an example of embedding an  
editor control
but this doesn't seem to fit what I want since I always want the  
control to appear
and I have no intention of allowing the contents of the cell to be  
edited...

Would it be possible to point me at an example or if it's not too  
much trouble
provide an example of how this is done?


Thanks for your time.

Tyler

On 03/11/2006, at 3:58 AM, Josiah Carlson wrote:

>
> 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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users- 
> help at lists.wxwidgets.org
>





More information about the wxpython-users mailing list