2001-09-16 23:15:56 +00:00
|
|
|
// GTK.Widget.cs - GTK Widget class implementation
|
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
|
|
|
// (c) 2001 Mike Kestner
|
|
|
|
|
|
|
|
namespace GTK {
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
public abstract class Widget : Object {
|
|
|
|
|
|
|
|
/// <summary>
|
2001-09-18 03:57:16 +00:00
|
|
|
/// Delete Event
|
2001-09-16 23:15:56 +00:00
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
2001-09-18 03:57:16 +00:00
|
|
|
/// Occurs when the Widget is deleted by the window
|
|
|
|
/// manager.
|
2001-09-16 23:15:56 +00:00
|
|
|
/// </remarks>
|
|
|
|
|
2001-09-18 03:57:16 +00:00
|
|
|
private static readonly object DeleteEvent = new object ();
|
|
|
|
|
|
|
|
public event EventHandler Delete
|
2001-09-16 23:15:56 +00:00
|
|
|
{
|
2001-09-18 03:57:16 +00:00
|
|
|
add
|
|
|
|
{
|
|
|
|
if (Events[DeleteEvent] == null)
|
|
|
|
{
|
|
|
|
ConnectSignal ("delete-event", new SimpleCallback (EmitDeleteEvent));
|
|
|
|
}
|
|
|
|
Events.AddHandler (DeleteEvent, value);
|
|
|
|
}
|
|
|
|
remove
|
|
|
|
{
|
|
|
|
Events.RemoveHandler (DeleteEvent, value);
|
|
|
|
}
|
2001-09-16 23:15:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void EmitDeleteEvent (IntPtr obj)
|
|
|
|
{
|
2001-09-18 03:57:16 +00:00
|
|
|
EventHandler eh = (EventHandler)(_events[DeleteEvent]);
|
|
|
|
if (eh != null)
|
|
|
|
{
|
2001-09-16 23:15:56 +00:00
|
|
|
EventArgs args = new EventArgs ();
|
2001-09-18 03:57:16 +00:00
|
|
|
eh(this, args);
|
2001-09-16 23:15:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Show Method
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Makes the Widget visible on the display.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern void gtk_widget_show (IntPtr obj);
|
|
|
|
|
|
|
|
public void Show ()
|
|
|
|
{
|
|
|
|
gtk_widget_show (obj);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|