adapted from:
// togglebut.cs
using Gtk;
using GtkSharp;
using System;
using System.Drawing;
public class togglebuttons
{
public static void Main(string[] args)
{
Application.Ini t();
Window window = new Window("toggle my buttons");
window.DeleteEv ent += new DeleteEventHand ler (delete_event);
/* Creating a new ToggleButton */
ToggleButton togglebutton = new ToggleButton ("Ding Dong!");
togglebutton.Cl icked += new EventHandler (clickedCallbac k);
window.Add(togg lebutton);
window.ShowAll( );
Application.Run ();
}
static void delete_event (object obj, DeleteEventArgs args)
{
Application.Qui t();
}
static void clickedCallback (object obj, EventArgs args)
{
/* Check Active Property */
if (((ToggleButton ) obj).Active)
Console.WriteLi ne("Hello Dumass!");
}
}
--
// togglebut.cs
using Gtk;
using GtkSharp;
using System;
using System.Drawing;
public class togglebuttons
{
public static void Main(string[] args)
{
Application.Ini t();
Window window = new Window("toggle my buttons");
window.DeleteEv ent += new DeleteEventHand ler (delete_event);
/* Creating a new ToggleButton */
ToggleButton togglebutton = new ToggleButton ("Ding Dong!");
togglebutton.Cl icked += new EventHandler (clickedCallbac k);
window.Add(togg lebutton);
window.ShowAll( );
Application.Run ();
}
static void delete_event (object obj, DeleteEventArgs args)
{
Application.Qui t();
}
static void clickedCallback (object obj, EventArgs args)
{
/* Check Active Property */
if (((ToggleButton ) obj).Active)
Console.WriteLi ne("Hello Dumass!");
}
}
--