Example of using a Grid and GridTableBase

I’ve searched high and low, but I can’t find a recent example anywhere .

I have some data: column headers in one list and rows in another list. I’d like to add them to a Grid using a GridTableBase, but I’m stumped! Could someone please give me a simple example?

Thanks in Advance!

There’s a GridTableBase example on the wx.Python’s Demo (file GridCustTable.py). Headers and data are on different lists and it’s very simple. Isn’t that what you are looking for?

It could be. I didn’t see it in the demo’s that I looked at, but it is possible I looked in the wrong place. I’ll try again. If you happen to feel generous and know where it is at, a link would be greatly appreciated!

You can download the wxPython demo here: https://extras.wxpython.org/wxPython4/extras/

Select the folder that matches your setup, download and save the file wxPython-demo-…tar.gz somewhere. The file file GridCustTable.py is inside the ‘demo’ folder.

You can also try the other grid examples running them directly from the demo using “python3 demo.py”.

Thank you ever so much!