mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-07-31 23:18:10 +02:00
![Mike Kestner](/assets/img/avatar_default.png)
* HACKING : New rulez. * NOTES: Killed. We have a mailing list now for this kind of stuff. * glib/makefile : New, to build the new glib-sharp.dll target. * glib/Object.cs : (GetObject): Commented out. Design problems here. IntPtr's can't be used in the manner this code attempts to use them. (Data prop): Commented out. Apparently keyed properties are not supported. (Object prop): Renamed RawObject, and made it protected. (Events): Fixed to cause list to be initialized if null and then return the list. * glib/ObjectManager.cs : commented out entirely. Not sure what this code is trying to accomplish and it doesn't compile. * glib/Value.cs : New attempt at implementing GValues. Doesn't work yet. * gtk/Button.cs : Updated to use RawObject. (Clicked event): s/EmitDeleteEvent/EmitClickedEvent. (Button(String)): s/gtk_label_new_with_lable/gtk_button_new_with_label. * gtk/Label.cs : Fixed some yank and paste errors where 2 value params were getting passed to all the set_* property methods. * gtk/Window.cs : Fixed hanging GTK namespace ref. * sample/HelloWorld.cs : Fixed hanging GTK namespace ref. svn path=/trunk/gtk-sharp/; revision=884
69 lines
1.3 KiB
C#
Executable File
69 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.Runtime.InteropServices;
|
|
|
|
public abstract class Widget : Object {
|
|
|
|
/// <summary>
|
|
/// Delete Event
|
|
/// </summary>
|
|
///
|
|
/// <remarks>
|
|
/// Occurs when the Widget is deleted by the window
|
|
/// manager.
|
|
/// </remarks>
|
|
|
|
private static readonly object DeleteEvent = new object ();
|
|
|
|
public event EventHandler Delete
|
|
{
|
|
add
|
|
{
|
|
if (Events[DeleteEvent] == null)
|
|
{
|
|
ConnectSignal ("delete-event", new SimpleCallback (EmitDeleteEvent));
|
|
}
|
|
Events.AddHandler (DeleteEvent, value);
|
|
}
|
|
remove
|
|
{
|
|
Events.RemoveHandler (DeleteEvent, value);
|
|
}
|
|
}
|
|
|
|
private void EmitDeleteEvent (IntPtr obj)
|
|
{
|
|
EventHandler eh = (EventHandler)(Events[DeleteEvent]);
|
|
if (eh != null)
|
|
{
|
|
EventArgs args = new EventArgs ();
|
|
eh(this, args);
|
|
}
|
|
}
|
|
|
|
/// <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 (RawObject);
|
|
|
|
}
|
|
}
|
|
}
|