[gtkmm] TreeView



Hello ml,

i tried to build up a small application with a list in it. so i chosse
Gtk TreeView for the list element.

Now i tried to put some cols and rows in it but i failed :( .

I tried the following example
http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch08.html

But i get this errormessage when i compile it.

----8<-------8<---------8<-------
frmMain.cc: In constructor `frmMain_glade::frmMain_glade()':
frmMain.cc:79: `Gtk::TreeIter' is an inaccessible base of `
   Gtk::TreeNodeChildren'
make[2]: *** [frmMain_glade.o] Error 1
make[2]: Leaving directory `/home/jan/Projects/ControlCenter/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jan/Projects/ControlCenter'
make: *** [all] Error 2
jan jan listview $


My source code:
----8<-------8<---------8<-------
// A part of the frmMain.cc File
ModelColumns m_Columns;
Glib::RefPtr<Gtk::ListStore> m_refListStore =
Gtk::ListStore::create(m_Columns);
Gtk::TreeModel::iterator iter = m_refListStore->append();
Gtk::TreeModel::Row row = *iter;

Gtk::TreeModel::iterator iter_child =
m_refListStore->insert(row.children());
// ^^^^^^----- this line causes the errormessage
// Gtk::TreeModel::iterator iter_child =
m_refListStore->append(row.children());
// ^^^---- this works not, too

// the class definition in the .hh file
class ModelColumns : public Gtk::TreeModel::ColumnRecord
{
public:

  ModelColumns()
    { add(m_col_text); add(m_col_number); }

  Gtk::TreeModelColumn<Glib::ustring> m_col_text;
  Gtk::TreeModelColumn<int> m_col_number;
};
	



Thank's for all your help
jan





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