You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't really an answer, because I'm only currently working with strings, but I'm going through a similar process of trying to get model binding working with the dynamic GTK4 gridviews. In case it's helpful, I've got a version of your code working using a backing gtk.StringList, rather than the gio.ListStore:
Rather than calling gio.NewListStore and then appending an item to it, I create a StringList with:
store := gtk.NewStringList([]string{"Test 1", "Test 2"})
and then the only other relevant change is the data binding, so replacing <lookup name="label"> with <lookup name="string" type="GtkStringObject">.
After that, I get a view that shows two text labels as expected ("Test 1" and "Test 2").
I'll also need to build a more complex / custom data model, so I'll keep working on this, too.
I want to use the GTK 4 GridView with a gio.ListStore and a BuilderListItemFactory but cannot figure out how to add an item.
This is my test code:
This code panics. I guess I am creating the item incorrectly. Or do I have to define my own
coreglib.Type
like in the GTK C demo?Any help would be much appreciated. If we can make this work, I will submit a PR to add an example for the GridView. Thanks a lot.
The text was updated successfully, but these errors were encountered: