Using Gio::ListStore with custom content type and Gtk::ListView (Gtkmm 4)



Hello,

I would like to use `Gtk::ListView` to display a custom type held in a `Gio::ListStore`, but inside my `on_bind(list_item)` handler `list_item->get_item()` returns a null RefPtr. I also get the same "Failed to wrap" error seen [here](https://stackoverflow.com/questions/3233727/what-has-to-be-glibinited-in-order-to-use-glibwrap), but adding `Glib::init()` at the start of my program didn't help.

I haven't been able to get the ListStore working with any types, including the example custom `Glib::Object` shown [here](https://github.com/GNOME/glibmm/blob/master/examples/properties/properties_example.cc) and provided Object types like `Gtk::Box`. `Gtk::StringList` works fine, so I suspect the problem lies in how I'm using the ListStore.

Has anyone produced a known-working example of a `Gtk::ListView` which displays custom objects?

Kind regards,

Jackson Campolattaro

--
Jackson Campolattaro
Masters Student at TU Delft


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]