[gtkmm] Understanding TreeView



Hi,

I'm trying to understand Gtk::TreeView and its friends.

So, with a TreeView, I can append columns using the append_column member
function.  There is two of these:

int Gtk::TreeView::append_column (  const Glib::ustring& title,     const TreeModelColumn<ColumnType>& model_column )

int Gtk::TreeView::append_column (  TreeViewColumn& column )

Using the former, is it right to assume that the TreeViewColumn is actually a CellRendererText?

Because these two code examples yields the same results:

1:
    _treeview.append_column("Description", _cols.description);

2:
    Gtk::CellRendererText *celltext = new Gtk::CellRendererText();
    Gtk::TreeViewColumn *column = new Gtk::TreeViewColumn("Description", *Gtk::manage(celltext));
  
    column->add_attribute(celltext->property_text(), _cols.description);
  
    _treeview.append_column(*Gtk::manage(column));

By the way, gtkmm needs a good and simple TreeView example, the
cellrenderercustom example is powerful but very poor to learn from.
Should I open a bug for this?


  - Morten.

--
http://wtf.dk/



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