I have a GtkColumnView with two columns.
Each row contains two GtkEntry widgets. The data from these are linked to a GListStore holding tuples.
The user can add and delete rows, after which the list is sorted.
I cannot work out how to get the data out of the GListStore! It’s like I have a write only memory
What is the procedure to iterate over a GListStore to read the data?
Is there another way to get the data from the GtkColumnView that I missed?
At the moment I’m adding a data element to the GtkColumnView to hold a pointer to the GListStore because I couldn’t find an API way to access the GListStore from the GtlColumnView widget. This is way to hacky to be correct
… what is the correct way to get access to the GtkColumnViewGListStore ?
Of course I saw that but the documentation says that this returns “GtkSelectionModel *”.
Looking at the documentation for GtkSelectionModel I see ways to get the selected items but not a general access to the store. Are you implying that I just need to cast the GtkSelectionModel to GListModel ?
edit:
I just tried that and it did work… I’m perplexed as to how anyone would have arrived at that method using the documentation
Did you go to the GtkSelectionModel page? If you do, you’ll see that it’s an interface, and any implementation of the GtkSelectionModel interface must also be a GListModel implementation, as it is a prerequisite of the type.
I don’t need to imply it: it’s clearly stated in the documentation.
The whole type system is based on well-defined inheritance rules: you need to become acquainted with them if you want to use the GTK API.