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