Re: toggle button in TreeView not editable - appended with append_column_editable
- From: "Milosz Derezynski" <internalerror gmail com>
- To: "Christopher Lang" <christopher lang acurana de>
- Cc: gtkmm-list gnome org
- Subject: Re: toggle button in TreeView not editable - appended with append_column_editable
- Date: Sat, 27 Oct 2007 16:44:46 +0200
The togglebutton is just an indicator (going with MVC stuff here); that means that you need to set up a callback on:
http://gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1CellRendererToggle.html#0332ce9231ca8d0694f7f1e1b2350bf4and in that callback, which gives you a string tree path, do whatever should be done when it's clicked, and change the state of the togglebutton (just negating the state of model_columns.active for that row, and using property_active() of the Renderer to reflect the new state).
HTH
Milosz
On 10/26/07, Christopher Lang <christopher lang acurana de> wrote:
Hi,
I am more or less using the TreeView example from the gtkmm book:
Figure 8.5. TreeView - Editable Cells
For some reason my toggle button in the Treeview is not editable (it doesn't
check when I click on it, but it is not greyed out). The string (userid in
the code below) actually is editable.
Is there anything special that I need to do to get an editable toggle button
in the treeview other than adding it with append_column_editable?
class ModelColumns : public TreeModel::ColumnRecord
...
TreeModelColumn<bool> active;
TreeModelColumn<Glib::ustring> userid;
...
ModelColumns model_colums;
...
sub1_treeview1->append_column_editable("Active", model_colums.active);
sub1_treeview1->append_column_editable("User ID", model_colums.userid);
many thanks
Chris
http://www.acurana.de/
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]