mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-24 17:35:28 +00:00
3c0213de88
* gdk/SimpleEvent.cs : Temporarily comment the GCHandle code until a layout is ready and exceptions can be avoided. * gtk/Widget.cs : Killed all the signal and event attaching methods. They never belonged here, and now they exist in the SimpleEvent. Add a Signals hash to hold refs of the Signal handlers. Killed default ctor and the dtor. The event Add/Remove methods now create a SimpleEvent, stuff it in the hash, and remove it when the last handler disappears. svn path=/trunk/gtk-sharp/; revision=1078
55 lines
1.3 KiB
C#
Executable file
55 lines
1.3 KiB
C#
Executable file
// GTK.Widget.cs - GTK Widget class implementation
|
|
//
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
//
|
|
// (c) 2001 Mike Kestner
|
|
|
|
namespace Gtk {
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using System.Runtime.InteropServices;
|
|
using GLib;
|
|
using Gdk;
|
|
|
|
|
|
public class Widget : Object {
|
|
|
|
private static readonly string DelEvName = "delete-event";
|
|
|
|
private Hashtable Signals = new Hashtable ();
|
|
|
|
public event EventHandler DeleteEvent {
|
|
add {
|
|
if (Events [DelEvName] == null)
|
|
Signals [DelEvName] = new SimpleEvent (
|
|
this, RawObject,
|
|
DelEvName, value);
|
|
|
|
Events.AddHandler(DelEvName, value);
|
|
}
|
|
remove {
|
|
Events.RemoveHandler(DelEvName, value);
|
|
if (Events [DelEvName] == null)
|
|
Signals.Remove (DelEvName);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Show Method
|
|
/// </summary>
|
|
///
|
|
/// <remarks>
|
|
/// Makes the Widget visible on the display.
|
|
/// </remarks>
|
|
|
|
[DllImport("gtk-1.3.dll")]
|
|
static extern void gtk_widget_show (IntPtr obj);
|
|
|
|
public void Show ()
|
|
{
|
|
gtk_widget_show (RawObject);
|
|
}
|
|
}
|
|
}
|