Hi again,

>From an earlier thread I found the columnview demo (
https://gitlab.gnome.org/GNOME/gtkmm/-/blob/master/demos/gtk-demo/example_listview_columnview.cc),
which was exactly what I needed!

In case anyone runs into the same problem as I did, my mistake was using
`std::make_shared` to create new instances, when I should have been using
`Glib::make_refptr_for_instance`.

Have a good day,

Jackson

On Sun, Feb 20, 2022 at 6:36 PM Jackson Campolattaro <jackc...@vt.edu>
wrote:

> 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
>


-- 
Jackson Campolattaro
Masters Student at TU Delft
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to