mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-25 08:15:43 +00:00
e83c55a242
* */Makefile.am : automakify the build * */Makefile.in : kill * *.custom : remove System.Drawing dependencies * *.cs : remove System.Drawing dependencies * *-api.xml : mv to *-api.raw * glue/* : mv to lib specific gluelibs for glib, gdk, gtk, and glade. * gtk/gtk-symbols : alias GtkType to GType * sources/gtk-sharp-sources.xml : create .raw files. They are now transformed to .xml files by the metadata compilation step. svn path=/trunk/gtk-sharp/; revision=23967
55 lines
1 KiB
C#
Executable file
55 lines
1 KiB
C#
Executable file
// Subclass.cs - Widget subclass Test
|
|
//
|
|
// Author: Mike Kestner <mkestner@ximian.com>
|
|
//
|
|
// (c) 2001-2003 Mike Kestner, Novell, Inc.
|
|
|
|
namespace GtkSamples {
|
|
|
|
using Gtk;
|
|
using System;
|
|
|
|
public class ButtonApp {
|
|
|
|
public static int Main (string[] args)
|
|
{
|
|
Application.Init ();
|
|
Window win = new Window ("Button Tester");
|
|
win.DeleteEvent += new DeleteEventHandler (Quit);
|
|
Button btn = new MyButton ();
|
|
win.Add (btn);
|
|
win.ShowAll ();
|
|
Application.Run ();
|
|
return 0;
|
|
}
|
|
|
|
static void Quit (object sender, DeleteEventArgs args)
|
|
{
|
|
Application.Quit();
|
|
}
|
|
}
|
|
|
|
public class MyButton : Gtk.Button {
|
|
|
|
static GLib.GType gtype = GLib.GType.Invalid;
|
|
|
|
public MyButton () : base (GType)
|
|
{
|
|
Label = "I'm a subclassed button";
|
|
}
|
|
|
|
public static new GLib.GType GType {
|
|
get {
|
|
if (gtype == GLib.GType.Invalid)
|
|
gtype = RegisterGType (typeof (MyButton));
|
|
return gtype;
|
|
}
|
|
}
|
|
|
|
protected override void OnClicked ()
|
|
{
|
|
Console.WriteLine ("Button::Clicked default handler fired.");
|
|
}
|
|
}
|
|
}
|