Implementing own 2D-grid-like TreeModel with gtkmm3



Hi, i am trying to implement own TreeView model, by deriving from TreeModel class.

Currently it looks like this:

--------------------------- 8< -------------------------------
template <class T>
class GridModel
        : public Glib::Object
        , public Gtk::TreeModel
{
public:
    GridModel();
    virtual ~GridModel();

protected:
    /* lots of virtual methods to override and implement */

    std::vector< std::vector<T> > grid; // <-- how to make this better?
};
--------------------------- 8< -------------------------------

But is this good?

Is there a way to get rid of templating model class itself, hide this template somehow so implementation will be possible to reside in .cpp file instead of dumping everything into header just because of template?

Is there any mechanisms for that in gtkmm3 ?


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