gtk-sharp0.0.0.0neutralGtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.A places a discrete next to a widget.
A places a discrete next to a widget, usually a . See for more information about toggle/check buttons.
using System;
using Gtk;
class CheckButtonSample
{
CheckButton cb;
static void Main ()
{
new CheckButtonSample ();
}
CheckButtonSample ()
{
Application.Init ();
Window win = new Window ("CheckButtonSample");
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
VBox vbox = new VBox (true, 1);
win.Add (vbox);
cb = new CheckButton ("Checked");
cb.Toggled += new EventHandler (OnCheckToggled);
vbox.Add (cb);
win.ShowAll ();
Application.Run ();
}
void OnCheckToggled (object obj, EventArgs args)
{
if (cb.Label == "Checked")
{
cb.Label = "Unchecked";
}
else
{
cb.Label = "Checked";
}
}
void OnWinDelete (object obj, DeleteEventArgs args)
{
Application.Quit ();
}
}
Gtk.ToggleButtonAtk.ImplementorGLib.IWrapperGLib.IWrapperSystem.IDisposableMethodGtk.CheckButtonCreates a new object with a label to the right of it.
The label displayed to the right of the .
The newly created .Creates a new object with a to the
right of itMethodSystem.VoidDisposes the resources associated with the object.ConstructorInternal constructor
Pointer to the C object.
An instance of , wrapping the C object.This is an internal constructor, and should not be used by user code.ConstructorConstructorA new ConstructorConstructor
A string for the .
A new with a PropertyGLib.GTypeGType Property.a Returns the native value for .ConstructorProtected Constructor.
a a Chain to this constructor if you have manually registered a native value for your subclass.