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!
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
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
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.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
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.
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.
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.
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.