Reputation: 2754
I'm making a GUI application with gtk2hs. Most of the GUI is designed in Glade.
I now need a table to show some data. The problem is, that I can't find the table in glade. I searched in the Container category, but only found a "Grid". However I couldn't find a Grid in the documentation of gtk2hs, but I need the castTo*
function for the grid to use it.
I'm now wondering where the Table in glade is or how I can use the grid in gtk2hs.
My glade version: 3.18.2
My gtk2hs version: 0.12.5.7
Upvotes: 0
Views: 4695
Reputation: 373
In GTK, tables are a way of arranging widgets on a window. There are also boxes, notebooks etc. They can't be used to display data.
For showing data, you need a TreeView and a TreeModel.
You store your data in a TreeModel, typically a ListStore or a TreeStore, and use a TreeView to show the data as rows with columns (from a ListStore) or as a tree (TreeStore).
If you modify the data in the TreeModel, the TreeView updates itself accordingly.
Moreover:
Finally, through the TreeView you can react to user interaction (mouse clicks, cell and/or node edition etc.).
Upvotes: 4