Treeview with editable checkboxes besides items?



How can I create a treeview with editable checkboxes besides the items?

If I simply add two columns (one for the checkbox and one for the item), the checkbox is easily made editable. But it doesn't look very nice, because the treeview expander is always associated with one of the columns.

If I add only one column with two cellrenderers the treeview looks the way I want it, but I can't edit the checkbox anymore. I'm using this code:

Gtk::CellRendererToggle* pActive = new Gtk::CellRendererToggle();
Gtk::CellRendererText* pName = new Gtk::CellRendererText();
Gtk::TreeView::Column* pColumn = new Gtk::TreeView::Column("Name");
pActive->property_activatable () = true;
//pName->property_editable() = true;
pColumn->pack_start(*pActive, false);
pColumn->pack_start(*pName);
pColumn->add_attribute(pActive->property_active (), m_columns.active);
pColumn->add_attribute(pName->property_text (), m_columns.name);
m_treeview->append_column(*pColumn);

The strange thing is property_activatable (for the checkbox) does not seem to work, but property_editable (for the name) does!




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