[Gtk-sharp-list] Re: [Mono-list] Syntax Error???

Duncan Mak duncan@ximian.com
22 Feb 2003 17:04:12 -0500

Hello Santiago!

On Sat, 2003-02-22 at 16:48, Santiago Erquicia wrote:
> I am having problems with a simple class under mono 0.19.  I copied the 
> FileSelection class from test in order to try something.  When I tried to 
> compile it there was some syntax errors. I tried to trim it down and nothing 
> happended.  I am attaching the file.

Just writing that, is not enough. You need to have a method declared, on
top of a class.

> public class FileSelection
> {
>         FileSelection window = new FileSelection();
>        window.ShowAll();
> }

If you just want to get a FileSelection up, this is what you do:

using System.IO;
using Gtk;

class X {
	static void Main ()
		Application.Init ();
		FileSelection window = new FileSelection
(Directory.GetCurrentDirectory ());
		window.ShowAll ();
		Application.Run ();

Duncan Mak <duncan@ximian.com>