[Mono-list] HelloWorld.cs

Nick Loeve mono@trickie.org
Wed, 13 Oct 2004 11:33:12 +1000


--Apple-Mail-1--935091494
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=WINDOWS-1252;
	format=flowed

try compiling with:

msc -pkg:gtk-sharp helloworld.cs

Thats assuming you have GTK# installed....


On 13/10/2004, at 10:50 AM, Amrit Kohli wrote:

> I am still learning mono and C#, so forgive me what is probably a very=20=

> easy question for most of you.
>
> =A0
>
> I entered the following code from a HelloWorld type of application:
>
> =A0
>
> // helloworld.cs - Gtk# Tutorial example
>
> =A0
>
> namespace GtkSharpTutorial {
>
> =A0=A0=A0=A0=A0 using Gtk;
>
> =A0=A0=A0=A0=A0 using GtkSharp;
>
> =A0=A0=A0=A0=A0 using System;
>
> =A0=A0=A0=A0=A0 using System.Drawing;
>
> =A0
>
> =A0
>
> =A0=A0=A0=A0=A0 public class helloworld {
>
> =A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* This is a callback function. The =
data arguments are=20
> ignored
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* in this example. More on =
callbacks below. */
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 static void hello (object obj, =
EventArgs args)
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 {
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
Console.WriteLine("Hello World");
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Application.Quit =
();
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }
>
> =A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 static void delete_event (object =
obj, DeleteEventArgs args)
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 {
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* If you return =
FALSE in the "delete_event" signal=20
> handler,
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* GTK will emit =
the "destroy" signal. Returning=20
> TRUE means
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* you don't =
want the window to be destroyed.
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* This is =
useful for popping up 'are you sure you=20
> want to quit?'
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* type dialogs. =
*/
>
> =A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0 =
Console.WriteLine ("delete event occurred\n");
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0 =
Application.Quit ();
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }
>
> =A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 public static void Main(string[] =
args)
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 {
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* This is called =
in all GTK applications. Arguments=20
> are parsed
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* from the =
command line and are returned to the=20
> application. */
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Application.Init =
();
>
> =A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* create a new =
window */
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Window window =3D =
new Window ("helloworld");
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* When the window =
is given the "delete_event"=20
> signal (this is given
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* by the window =
manager, usually by the "close"=20
> option, or on the
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* titlebar), we =
ask it to call the delete_event ()=20
> function
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* as defined =
above. The data passed to the callback
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* function is =
NULL and is ignored in the callback=20
> function. */
>
> =A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 window.DeleteEvent =
+=3D new DeleteEventHandler=20
> (delete_event);
>
> =A0=A0=A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Sets the border =
width of the window. */
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 window.BorderWidth =
=3D 10;
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /*=A0 =
gtk_container_set_border_width (GTK_CONTAINER=20
> (window), 10);*/
>
> =A0=A0=A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Creates a new =
button with the label "Hello=20
> World". */
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Button btn =3D new =
Button ("Hello World");
>
> =A0=A0=A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* When the button =
receives the "clicked" signal, it=20
> will call the
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* function =
hello() passing it NULL as its=20
> argument.=A0 The hello()
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0* function is =
defined above. */
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 btn.Clicked +=3D =
new EventHandler (hello);
>
> =A0
>
> =A0=A0=A0=A0=A0=A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* This packs the =
button into the window (a gtk=20
> container). */
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 window.Add (btn);
>
> =A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* The final step =
is to display this newly created=20
> widget. */
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 window.ShowAll ();
>
> =A0=A0=A0
>
> =A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* All GTK =
applications must have a gtk_main().=20
> Control ends here
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 * and waits for an =
event to occur (like a key press=20
> or
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 * mouse event).
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 * In C#, we use =
Application.Run(), as used in=20
> Windows.Forms*/
>
> =A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Application.Run =
();
>
> =A0=A0=A0
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }
>
> =A0=A0=A0=A0=A0 }
>
> =A0
>
> }
>
> =A0
>
> =A0
>
> When I tried to compile it, I got the following errors:
>
> =A0
>
> helloworld.cs(20) error CS0246: Cannot find type `DeleteEventArgs'
>
> helloworld.cs(4) error CS0246: The namespace `Gtk' can not be found=20
> (missing assembly reference?)
>
> =A0=A0=A0 Try using -r:gtk-sharp
>
> helloworld.cs(5) error CS0246: The namespace `GtkSharp' can not be=20
> found (missing assembly reference?)
>
> =A0=A0=A0 Try using -r:gtk-sharp
>
> helloworld.cs(7) error CS0246: The namespace `System.Drawing' can not=20=

> be found (missing assembly reference?)
>
> =A0=A0=A0 Try using -r:System.Drawing
>
> Compilation failed: 4 error(s), 0 warnings
>
> =A0
>
> =A0
>
> So, I tried to do :
>
> =A0
>
> =D8=A0=A0=A0=A0=A0=A0 mcs =96r:gtk-sharp helloworld.cs
>
> =A0
>
> That produced the error message:
>
> =A0
>
> error CS0006: Cannot find assembly `gtk-sharp'
>
> Log:
>
> =A0
>
> Compilation failed: 1 error(s), 0 warnings
>
> =A0
>
> =A0
>
> How do I install the GTK libraries? =A0I am using mono v1.0.2 for=20
> windows. =A0I=92m guessing from the little bit of research I=92ve done =
that=20
> I have to compile the GTK# source into an =93assembly=94 or binary. =
=A0Also,=20
> where would I put the GTK libraries when I finally do install them?
>
> =A0
>
> Thanks,
>
> =A0
>
> Amrit
>
> ----
>
> Amrit Kohli
>
> amrit@wayne.edu
>
> =A0

--Apple-Mail-1--935091494
Content-Transfer-Encoding: quoted-printable
Content-Type: text/enriched;
	charset=WINDOWS-1252

try compiling with:


msc -pkg:gtk-sharp helloworld.cs


Thats assuming you have GTK# installed....



On 13/10/2004, at 10:50 AM, Amrit Kohli wrote:


<excerpt><fixed><fontfamily><param>Courier New</param><x-tad-bigger>I
am still learning mono and C#, so forgive me what is probably a very
easy question for most of you.</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>I entered
the following code from a HelloWorld type of =
application:</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>//
helloworld.cs - Gtk# Tutorial =
example</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>namespace
GtkSharpTutorial {</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
 using
Gtk;</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
 using
GtkSharp;</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
 using
System;</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
 using
System.Drawing;</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=

public class helloworld {</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0
/* This is a callback function. The data arguments are =
ignored</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0
=A0* in this example. More on callbacks below. =
*/</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0
static void hello (object obj, EventArgs =
args)</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 {</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

Console.WriteLine("Hello World");</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

Application.Quit ();</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 }</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0
static void delete_event (object obj, DeleteEventArgs =
args)</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 {</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/* If you return FALSE in the "delete_event" signal =
handler,</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* GTK will emit the "destroy" signal. Returning TRUE =
means</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* you don't want the window to be =
destroyed.</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* This is useful for popping up 'are you sure you want to =
quit?'</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* type dialogs. */</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0=A0=A0 Console.WriteLine ("delete event =
occurred\n");</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0=A0=A0 Application.Quit ();</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 }</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0
public static void Main(string[] =
args)</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 {</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/* This is called in all GTK applications. Arguments are =
parsed</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* from the command line and are returned to the application. =
*/</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

Application.Init ();</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/* create a new window */</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

Window window =3D new Window =
("helloworld");</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/* When the window is given the "delete_event" signal (this is =
given</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* by the window manager, usually by the "close" option, or on =
the</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* titlebar), we ask it to call the delete_event () =
function</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* as defined above. The data passed to the =
callback</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* function is NULL and is ignored in the callback function. =
*/</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

window.DeleteEvent +=3D new DeleteEventHandler =
(delete_event);</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/* Sets the border width of the window. =
*/</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

window.BorderWidth =3D 10;</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/*=A0 gtk_container_set_border_width (GTK_CONTAINER (window), =
10);*/</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/* Creates a new button with the label "Hello World". =
*/</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

Button btn =3D new Button ("Hello =
World");</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/* When the button receives the "clicked" signal, it will call =
the</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* function hello() passing it NULL as its argument.=A0 The =
hello()</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0* function is defined above. */</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

btn.Clicked +=3D new EventHandler =
(hello);</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0</x-tad-bigger></fontfamily></f=
ixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/* This packs the button into the window (a gtk container). =
*/</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

window.Add (btn);</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/* The final step is to display this newly created widget. =
*/</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

window.ShowAll ();</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

/* All GTK applications must have a gtk_main(). Control ends =
here</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

* and waits for an event to occur (like a key press =
or</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

* mouse event).</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

* In C#, we use Application.Run(), as used in =
Windows.Forms*/</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

Application.Run ();</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
 }</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0=A0=A0=
 }</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>}</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>When I
tried to compile it, I got the following =
errors:</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>helloworld.cs(20)
error CS0246: Cannot find type =
`DeleteEventArgs'</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>helloworld.cs(4)
error CS0246: The namespace `Gtk' can not be found (missing assembly
reference?)</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0 Try
using -r:gtk-sharp</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>helloworld.cs(5)
error CS0246: The namespace `GtkSharp' can not be found (missing
assembly reference?)</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0 Try
using -r:gtk-sharp</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>helloworld.cs(7)
error CS0246: The namespace `System.Drawing' can not be found (missing
assembly reference?)</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>=A0=A0=A0 Try
using -r:System.Drawing</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>Compilation
failed: 4 error(s), 0 warnings</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>So, I tried
to do :</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


=
<x-tad-bigger>=D8</x-tad-bigger></excerpt><excerpt><fontfamily><param>Time=
s New Roman</param><smaller><x-tad-smaller>=A0=A0=A0=A0=A0=A0
=
</x-tad-smaller></smaller></fontfamily></excerpt><excerpt><fixed><fontfami=
ly><param>Courier New</param><x-tad-bigger>mcs
=96r:gtk-sharp helloworld.cs</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>That
produced the error message:</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>error
CS0006: Cannot find assembly =
`gtk-sharp'</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>Log:</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>Compilation
failed: 1 error(s), 0 warnings</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>How do I
install the GTK libraries? =A0I am using mono v1.0.2 for windows. =A0I=92m=

guessing from the little bit of research I=92ve done that I have to
compile the GTK# source into an =93assembly=94 or binary. =A0Also, where
would I put the GTK libraries when I finally do install =
them?</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>Thanks,</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>Amrit</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>----</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier New</param><x-tad-bigger>Amrit =
Kohli</x-tad-bigger></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>amrit@wayne.edu</x-tad-bigger></fontfamily></fixe=
d>


<fixed><fontfamily><param>Courier =
New</param><x-tad-bigger>=A0</x-tad-bigger></fontfamily></fixed>

</excerpt>=

--Apple-Mail-1--935091494--