Re: How to make a single cell editable in Gtk::TreeView?

2012-03-06 08:48, Gerardo Ballabio skrev:
2012/3/4 Kjell Ahlstedt<kjell ahlstedt bredband net>:
The attached file is a modified version of  the treeview/editable_cells
example in the gtkmm tutorial.
I've added a bool column to the tree model, and connected it to the
"editable" attribute of two TreeView columns.
Search for "//!!". It shows where I've modified the treeview/editable_cells
example in the gtkmm tutorial. See also where
I show how to grey out one choice in a ComboBox. It's the same technique.
Use Gtk::CellLayout::add_attribute() in a combo box, or
Gtk::TreeViewColumn::add_attribute() in a tree view.
Thank you Kjell!
Could you please add a finishing touch: how do I activate the editable
cell so that it is already in editing mode when the window pops up?


I haven't tested this, but I think you shall call one of the Gtk::TreeView::set_cursor() methods with start_editing = true.


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