gtk-sharpGtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.Gtk.CellRendererRenders a or a This Class is a implementation that can render a checkbox in your columns.It is important to note that the will not change the corresponding bool field in your itself - you'll need to provide a handler, as shown in the following code snippet:
private TreeStore store;
void SetupTreeView ()
{
store = new TreeStore (typeof (string), typeof(bool));
// populate store..
TreeView tv = new TreeView (store);
tv.HeadersVisible = true;
tv.AppendColumn ("Name", new CellRendererText (), "text", 0);
CellRendererToggle crt = new CellRendererToggle();
crt.Activatable = true;
crt.Toggled += crt_toggled;
tv.AppendColumn ("CheckMe", crt, "active", 1);
// add the TreeView to some window...
}
void crt_toggled(object o, ToggledArgs args) {
TreeIter iter;
if (store.GetIter (out iter, new TreePath(args.Path))) {
bool old = (bool) store.GetValue(iter,1);
store.SetValue(iter,1,!old);
}
}
ConstructorCreates a new .The default constructor.Constructor
Pointer to the C object.
Internal constructorThis is an internal constructor, and should not be used by user code.PropertyGLib.Property("activatable")System.BooleanThe can be activated.an object of type PropertyGLib.Property("active")System.BooleanThe toggle state of the .an object of type PropertyGLib.GTypeGType Property.a Returns the native value for .PropertyGLib.Property("inconsistent")System.BooleanThe inconsistent state of the button.a PropertyGLib.Property("indicator-size")System.Int32Size of check or radio indicator.defaults to 12.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideToggled", Type=typeof(Gtk.CellRendererToggle))System.Void
a Default handler for the event.Override this method in a subclass to provide a default handler for the event.PropertyGLib.Property("radio")System.BooleanDraw the as a .an object of type EventGLib.Signal("toggled")Gtk.ToggledHandlerEmitted when the cell is clicked.