Re: Subclass Gtk::TreeModel
- From: Jens Krause <je krause bluewin ch>
- To: gtkmm-list gnome org
- Subject: Re: Subclass Gtk::TreeModel
- Date: Wed, 04 Apr 2018 16:25:38 +0200
Hallo Aitor
it took a while answer.
In your example you derive Gtk::TreeView but you use
plain Gtk::ListStore.
I would like to build my own storage class and therefore
derive from Gtk::TreeModel.
Regards
Jens
Hi,
I understand that one can implement custom TreeModels (to replace
Gtk::ListStore and Gtk::TreeStore). Can this be done by deriving
from Gtk::TreeModel? Do you have a tutorial on this subject.
What would be the skeleton of such a derived class?
class myModel : public ?Gtk::TreeModel{?
public:
Gtk::TreeModelFlags? get_flags_vfunc () const;
//.... and other vfuncs
};
Thanks for any hints.
Regards
Jens
Maybe, this example can help you:
https://git.devuan.org/aitor_czr/simple-netaid-gtk/tree/master/
Have a look at the treeview.cpp and the col_model.cpp
You can find another example in the gtkmm tutorial:
https://developer.gnome.org/gtkmm-tutorial/stable/sec-treeview-exampl
es.html.en
BTW, it'll not build succesfully in debian or devuan jessie (or
derivatives) due to the version of g++, getting the following errors:
[...]
simple-netaid-gtk/include/passwd_dialog.h:32:8: error: ?thread? in
namespace ?std? does not name a type
?? std::thread *m_WorkerThread;
window_main_worker.h:44:16: error: ?mutex? in namespace ?std? does
not
name a type
?? mutable std::mutex m_Mutex;
[...]
HTH,
? Aitor.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]