2001-09-17 01:15:56 +02:00
|
|
|
// TestWindow.cs - GTK Window class Test implementation
|
|
|
|
//
|
|
|
|
// 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)
|
|
|
|
{
|
|
|
|
Application.Init (ref args);
|
|
|
|
Window win = new Window ("Gtk# Hello World");
|
2001-12-04 20:34:26 +01:00
|
|
|
win.DefaultSize = new Size (200, 150);
|
2001-10-11 12:14:14 +02:00
|
|
|
win.Deleted += new EventHandler (Window_Delete);
|
2001-09-17 01:15:56 +02:00
|
|
|
win.Show ();
|
|
|
|
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
|
|
|
{
|
2001-12-04 20:34:26 +01:00
|
|
|
SimpleEventArgs sa = (SimpleEventArgs) args;
|
|
|
|
|
|
|
|
Console.WriteLine(sa.Event.type);
|
2001-09-17 01:15:56 +02:00
|
|
|
Application.Quit ();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|