Re: Glib::RefPtr



I'd like to use FlowBox::bind_list_store() in a photo-management application by building a set of ListStore<T_item> for the contents of each of several folders on a remote system (a time-consuming process), and then choosing which to display by binding the appropriate model. Problem is, when I try to bind a model that has previously been bound and then unbound (again quoting the documentation "If this FlowBox was already bound to a Gio::ListModel, that previous binding is destroyed."), I find that it's not just the binding that was destroyed, but the widgets within the model's <T_item>s are destroyed as well. I'd like to be able to copy the model (which is behind a RefPtr) and bind the copy, thereby avoiding having to rebuild the model each time I want to reuse it.

Actually, if I could serialize/deserialize the model a la Gtk::TextBuffer, that might also work. Is that doable?


On 10/08/2017 06:29 AM, Daniel Boles wrote:
Well, there is always operator->() ...

but what kind of object are you wanting to copy? There's a good chance it doesn't have the right semantics for that. Most mm objects are not copyable, just movable. (And most GObjects aren't copyable either; properties are not the only state they hold.)




_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list



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