2001-09-18 03:57:16 +00:00
|
|
|
// GTK.Button.cs - GTK Button class implementation
|
|
|
|
//
|
|
|
|
// Author: Bob Smith <bob@thestuff.net>
|
|
|
|
//
|
|
|
|
// (c) 2001 Bob Smith
|
|
|
|
|
2001-09-19 02:04:57 +00:00
|
|
|
namespace Gtk {
|
2001-09-18 03:57:16 +00:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
public class Button : Widget {
|
|
|
|
|
2001-09-21 14:03:17 +00:00
|
|
|
private static readonly string ClickedEvent = "clicked";
|
2001-09-27 17:17:33 +00:00
|
|
|
/*
|
2001-09-18 03:57:16 +00:00
|
|
|
public event EventHandler Clicked
|
|
|
|
{
|
|
|
|
add
|
|
|
|
{
|
2001-09-21 14:03:17 +00:00
|
|
|
AddSimpleEvent(ClickedEvent, value);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
remove
|
|
|
|
{
|
2001-09-21 14:03:17 +00:00
|
|
|
RemoveSimpleEvent (ClickedEvent, value);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
}
|
2001-09-27 17:17:33 +00:00
|
|
|
*/
|
2001-09-18 03:57:16 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Button Object Constructor
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Constructs a Button Wrapper.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
public Button (IntPtr o)
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
RawObject = o;
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
|
2001-09-27 17:17:33 +00:00
|
|
|
~Button ()
|
2001-09-25 15:56:50 +00:00
|
|
|
{
|
2001-09-27 17:17:33 +00:00
|
|
|
/* FIXME: Find legal way to do this eventually.
|
2001-09-25 15:56:50 +00:00
|
|
|
foreach (EventHandler e in Events[ClickedEvent])
|
|
|
|
{
|
|
|
|
Clicked -= e;
|
|
|
|
}
|
2001-09-27 17:17:33 +00:00
|
|
|
*/
|
2001-09-25 15:56:50 +00:00
|
|
|
}
|
|
|
|
|
2001-09-18 03:57:16 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Button Constructor
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Constructs a new Button with the specified content.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
[DllImport("gtk-1.3")]
|
2001-09-19 11:37:15 +00:00
|
|
|
static extern IntPtr gtk_button_new_with_label (String str);
|
2001-09-18 03:57:16 +00:00
|
|
|
|
|
|
|
public Button (String str)
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
RawObject = gtk_button_new_with_label (str);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|