Toggle buttons are the basis for check buttons and radio buttons, as such, many of the calls used for toggle buttons are inherited by radio and check buttons. I will point these out when we come to them.
using Gtk; using GtkSharp; using System; using System.Drawing; public class togglebuttons { public static void Main(string[] args) { Application.Init(); Window window = new Window("toggle buttons"); window.DeleteEvent += new DeleteEventHandler (delete_event); /* Creating a new ToggleButton*/ ToggleButton togglebutton = new ToggleButton ("button1"); togglebutton.Clicked += new EventHandler (clickedCallback); window.Add(togglebutton); window.ShowAll(); Application.Run(); } static void delete_event (object obj, DeleteEventArgs args) { Application.Quit(); } static void clickedCallback (object obj, EventArgs args) { /* Check Active Property */ if (((ToggleButton) obj).Active) Console.WriteLine ("ToggleButton clicked, I'm activating"); } }