Re: Can you put an std::shared_ptr inside a Gtk::TreeStore?



On Wed, 2015-07-22 at 21:39 +1000, Adam Nielsen wrote:
[snip]
However this requires storing an std::shared_ptr in a Gtk::TreeModel,
and I am not sure how to do this.

std::shared_ptr<> is copyable so that should work fine.

Simply declaring the column works from the C++ side (in that the code
compiles), but I'm not sure what data type to put in Glade for the
column in the Gtk::TreeStore declaration.  If I use any of the
standard
options (like gpointer) I get a conversion error when adding items to
the tree:
[snip]

Defining your TreeModel in glade for use in gtkmm is not really
supported though we've tried recently to make some simple cases work.
You are just lucky if it works. You'd be far better off just defining
your TreeModel (and how your TreeView shows (and interacts with) that
model) in C++.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com




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