Search code examples
gridwxpython

wxPython Tables to display data on full frame


I can't find anything in the docs. All the code I find is messy and all over the place; all I want to do, is have a table take up the whole frame, and have 6 columns;

  • ID
  • Name
  • Author
  • Type
  • Tags
  • More Info

The "More Info" column should have a button, which will call a function with the ID column as param. How would I do this? I want to be able to "fill" this table using an array, with each row


Solution

  • Have you thought about using a ListCtrl instead? I think that might work better. I especially like the ObjectListView widget, which is a nice object oriented wrapper of the ListCtrl.

    Note that neither the grid nor the ListCtrl really support buttons in their cells, although the grid might work better by using a custom renderer. On the other hand, there's a new widget called the UltimateListCtrl that supports putting ANY widget anywhere in it, so that's an option.