wx.Grid and row/column span

All,

I am working on trying to pitch wxPython as the platform to port a Tk app over to. One thing that the current app does is use a grid style widget which allows row/columns to be spanned. Is wx.Grid capable of doing something like this? Looking at the API, I don’t think it can. And if it is not able to, what do you guys suggest as a replacement widget which can do something like that? Any help is much appreciated. Thanks!

Best regards,

Nizam

What are you putting in the Grid?

If it's widgets, then A GridBagSizer can work wonders.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Yeah, different widgets would go in the grid. Sweet, I will try the GridBagSizer out. Thanks!

···

On 5/31/07, Christopher Barker < Chris.Barker@noaa.gov> wrote:

What are you putting in the Grid?

If it’s widgets, then A GridBagSizer can work wonders.

-Chris


Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov


To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Nizam Sayeed wrote:

All,

I am working on trying to pitch wxPython as the platform to port a Tk app over to. One thing that the current app does is use a grid style widget which allows row/columns to be spanned. Is wx.Grid capable of doing something like this? Looking at the API, I don't think it can.

It can. There is an example in the demo.

However since you are wanting to put other widgets in a grid layout then the wxGrid is not what you are looking for anyway. :wink:

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Nizam Sayeed wrote:

All,

I am working on trying to pitch wxPython as the platform to port a Tk
app over to. One thing that the current app does is use a grid style
widget which allows row/columns to be spanned. Is wx.Grid capable of
doing something like this? Looking at the API, I don’t think it can.

It can. There is an example in the demo.

However since you are wanting to put other widgets in a grid layout then

the wxGrid is not what you are looking for anyway. :wink:

Cool. Thanks. Now I have one more hurdle. Has anyone implemented multi-column sorting with wx.Grid? The app that we are planning to port uses a Tk-based widget called TableList which has this feature. One of the main drivers for us to look at other toolkits is that the TableList is extremely slow when you load it with a few thousands rows or more. But it does have some neat built-in features such as multi-column sorting.

I am pretty sure it wx.Grid can do it. I just wanted to see if someone had already done it. Otherwise, I may take a stab at it. :slight_smile:

Thanks much.

– Nizam

···

On 5/31/07, Robin Dunn robin@alldunn.com wrote:


Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org

wxPython’s wx.grid.Grid class should perform a lot better than that if you use a virtual table with it. To do this, you subclass wx.grid.PyGridTableBase; write your table base class in such a way that it virtualizes or caches the data, only re-fetching the data the long way around if the data has actually changed. The Grid will only look up the rows it is actually displaying at the time, and combined with an intelligently designed GridTableBase it will have no trouble keeping a large table smooth. You probably looked at the MegaGrid example in the demo; that’s somewhat less impactful because it’s simply generating its cell values on the fly anyway, but one can easily see the advantages of the caching/virtualization/view behavior.

···

On 6/1/07, Nizam Sayeed ibnameen@gmail.com wrote:

The app that we are planning to port uses a Tk-based widget called TableList which has this feature. One of the main drivers for us to look at other toolkits is that the TableList is extremely slow when you load it with a few thousands rows or more.