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



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 http://mail.gnome.org/archives/gtkmm-list/2012-February/msg00041.html 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.

Kjell

2012-03-03 01:22, Gerardo Ballabio skrev:
Hi all,
may I ask your help.

I'm trying to build a "best scores" dialog for a game I'm developing,
using a Gtk::TreeView with a Gtk::ListStore model.  When a player sets
a score that ranks within the best, a new entry must be added, and the
player must be able to write his name into that entry, but must not be
allowed to edit other existing entries.

That is, I need to make only a single cell editable.  In the
documentation and the examples I found how to make entire columns
editable, but couldn't understand how to make a single cell editable.
Can you please explain how to do that?

Thanks
  Gerardo


Attachment: TreeView_editable.tar.gz
Description: GNU Zip compressed data



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