2002-02-15 12:15:11 +01:00
|
|
|
// HelloWorld.cs - GTK Window class Test implementation
|
2001-09-17 01:15:56 +02:00
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
|
|
|
// (c) 2001 Mike Kestner
|
|
|
|
|
|
|
|
namespace GtkSamples {
|
|
|
|
|
2001-09-19 13:37:15 +02:00
|
|
|
using Gtk;
|
2001-12-04 20:34:26 +01:00
|
|
|
using Gdk;
|
|
|
|
using GtkSharp;
|
2001-09-17 01:15:56 +02:00
|
|
|
using System;
|
2001-10-02 03:27:44 +02:00
|
|
|
using System.Drawing;
|
2001-09-17 01:15:56 +02:00
|
|
|
|
|
|
|
public class HelloWorld {
|
|
|
|
|
|
|
|
public static int Main (string[] args)
|
|
|
|
{
|
2002-03-26 02:29:43 +01:00
|
|
|
Application.Init ();
|
2002-02-06 21:09:14 +01:00
|
|
|
Gtk.Window win = new Gtk.Window (Gtk.WindowType.Toplevel);
|
|
|
|
win.Title = "Gtk# Hello World";
|
2002-02-15 02:08:57 +01:00
|
|
|
win.DeleteEvent += new EventHandler (Window_Delete);
|
|
|
|
win.ShowAll ();
|
2001-09-17 01:15:56 +02:00
|
|
|
Application.Run ();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-09-21 16:03:17 +02:00
|
|
|
static void Window_Delete (object obj, EventArgs args)
|
2001-09-17 01:15:56 +02:00
|
|
|
{
|
2002-02-15 12:15:11 +01:00
|
|
|
SignalArgs sa = (SignalArgs) args;
|
2001-09-17 01:15:56 +02:00
|
|
|
Application.Quit ();
|
2002-02-15 12:15:11 +01:00
|
|
|
sa.RetVal = true;
|
2001-09-17 01:15:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|