implement ItemToggled
svn path=/trunk/gtk-sharp/; revision=19559
This commit is contained in:
parent
7bf40dfb69
commit
68ee3bc9b4
1 changed files with 9 additions and 20 deletions
|
@ -63,29 +63,18 @@ namespace GtkDemo
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: Finish implementing this function
|
|
||||||
private void ItemToggled (object o, ToggledArgs args)
|
private void ItemToggled (object o, ToggledArgs args)
|
||||||
{
|
{
|
||||||
Console.WriteLine("toggled {0} with value", args.Path);
|
|
||||||
|
|
||||||
GLib.Object cellRendererToggle = (GLib.Object) o;
|
GLib.Object cellRendererToggle = (GLib.Object) o;
|
||||||
Console.WriteLine("Column {0}",cellRendererToggle.Data["column"]);
|
int column = (int) cellRendererToggle.Data["column"];
|
||||||
//GLib.Value columnValue = new GLib.Value();
|
|
||||||
//column.GetProperty("column", columnValue);
|
Gtk.TreeIter iter;
|
||||||
//Console.WriteLine("toggled {0} with value", columnValue.Val);
|
if (store.GetIterFromString(out iter, args.Path))
|
||||||
|
{
|
||||||
CellRenderer cellRenderer = (CellRenderer) o;
|
bool val = (bool) store.GetValue(iter, column);
|
||||||
|
Console.WriteLine("toggled {0} with value {1}", args.Path, !val);
|
||||||
//Value value = new Value();
|
store.SetValue(iter, column, !val);
|
||||||
//cellRenderer.GetProperty("column", value);
|
}
|
||||||
//Console.WriteLine( value.Val );
|
|
||||||
// Gtk.TreeIter iter;
|
|
||||||
// if (store.GetIterFromString(out iter, args.Path))
|
|
||||||
// {
|
|
||||||
// bool val = (bool) store.GetValue(iter, 0);
|
|
||||||
// Console.WriteLine("toggled {0} with value {1}", args.Path, val);
|
|
||||||
// store.SetValue(iter, 2, !val);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddColumns (TreeView treeView)
|
private void AddColumns (TreeView treeView)
|
||||||
|
|
Loading…
Add table
Reference in a new issue