[Gtk-sharp-list] Hello world can't find Gtk???

Doug linux@dougsweb.net
10 Dec 2002 23:22:54 -0600


Hi Everybody,
	First let me say this stuff looks way cool!!! (Kudo's to all building
mono and gtk#)

I saw the helloworld.cs gui app
(http://gtk-sharp.sourceforge.net/gtk-hello-world.png) and tried to make
it myself. Mono(0.17) is installed and working fine, and I think Gtk# is
as well (at least it didn't error when I ran the usual
configure/make/makeinstall). I'm running a fairly vanilla install of
redhat 8.0.

	when I run mcs helloworld.cs I get 3 errors as follows:

HelloWorld.cs(16) error CS0246: Cannot find type 'Gtk.Window'
HelloWorld.cs(13) error CS0161: Not all code paths return a value
HelloWorld.cs(26) error CS0246: Cannot find type 'SignalArgs'

 
Should this no longer work or am I doing something wrong??? I'm pretty
new to C#, so I could just be making a stupid mistake I suppose. Any
help would be great!

Doug

Here's my code:


//Helloworld.cs - GTK Window Class Test

namespace GTKSamples
{
	using Gtk;
	using Gdk;
	using GtkSharp;
	using System;
	using System.Drawing;

public class HelloWorld
{
	public static int Main (string[] args)
	{
	Application.Init ();
	Gtk.Window win = new Gtk.Window(Gtk.WindowType.Toplevel);
	win.Title = "Gtk# Hello World";
	win.DeleteEvent += new EventHandler(Window_Delete);
	win.ShowAll ();
	Application.Run ();
	return 0;
	}

	static void Window_Delete (object obj, EventArgs args)
	{
	SignalArgs sa = (SignalArgs) args;
	Application.Quit ();
	sa.RetVal = true;
	}
}
}