// GTK.Button.cs - GTK Button class implementation // // Author: Bob Smith // // (c) 2001 Bob Smith namespace Gtk { using System; using System.Runtime.InteropServices; public class Button : Widget { private static readonly string ClickedEvent = "clicked"; public event EventHandler Clicked { add { AddSimpleEvent(ClickedEvent, value); } remove { RemoveSimpleEvent (ClickedEvent, value); } } /// /// Button Object Constructor /// /// /// /// Constructs a Button Wrapper. /// public Button (IntPtr o) { RawObject = o; } public ~Button () { foreach (EventHandler e in Events[ClickedEvent]) { Clicked -= e; } } /// /// Button Constructor /// /// /// /// Constructs a new Button with the specified content. /// [DllImport("gtk-1.3")] static extern IntPtr gtk_button_new_with_label (String str); public Button (String str) { RawObject = gtk_button_new_with_label (str); } } }