[Mono-list] HelloWorld.cs

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


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

Sorry...

mcs -pkg:gtk-sharp helloworld.cs

typing too quickly ;)


On 13/10/2004, at 11:33 AM, Nick Loeve wrote:

> 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=20
>> very 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=20
>> 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.=20
>> Arguments 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,=20
>> it 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.=20=

>> =A0Also, where would I put the GTK libraries when I finally do =
install=20
>> them?
>>
>> =A0
>>
>> Thanks,
>>
>> =A0
>>
>> Amrit
>>
>> ----
>>
>> Amrit Kohli
>>
>> amrit@wayne.edu
>>
>> =A0

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

Sorry...


mcs -pkg:gtk-sharp helloworld.cs


typing too quickly ;)



On 13/10/2004, at 11:33 AM, Nick Loeve wrote:


<excerpt>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-smaller>I
am still learning mono and C#, so forgive me what is probably a very
easy question for most of you.</x-tad-smaller></fontfamily></fixed>


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


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


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


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


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


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


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

using Gtk;</x-tad-smaller></fontfamily></fixed>


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

using GtkSharp;</x-tad-smaller></fontfamily></fixed>


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

using System;</x-tad-smaller></fontfamily></fixed>


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

using System.Drawing;</x-tad-smaller></fontfamily></fixed>


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


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


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

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


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


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


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


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


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
Console.WriteLine("Hello World");</x-tad-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
Application.Quit ();</x-tad-smaller></fontfamily></fixed>


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


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


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


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
=A0* type dialogs. */</x-tad-smaller></fontfamily></fixed>


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
=A0=A0=A0 Application.Quit ();</x-tad-smaller></fontfamily></fixed>


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


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


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


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
Application.Init ();</x-tad-smaller></fontfamily></fixed>


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
/* create a new window */</x-tad-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
window.BorderWidth =3D 10;</x-tad-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
=A0* function is defined above. */</x-tad-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


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


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
window.Add (btn);</x-tad-smaller></fontfamily></fixed>


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
window.ShowAll ();</x-tad-smaller></fontfamily></fixed>


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


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
* mouse event).</x-tad-smaller></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=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-smaller></fontfamily></fixed>


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0
Application.Run ();</x-tad-smaller></fontfamily></fixed>


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


<x-tad-bigger>=D8</x-tad-bigger>

<fontfamily><param>Times New Roman</param><smaller><x-tad-smaller>=A0=A0=A0=
=A0=A0=A0 =
</x-tad-smaller></smaller></fontfamily></excerpt></excerpt><excerpt><excer=
pt>

<fixed><fontfamily><param>Courier New</param><x-tad-smaller>mcs
=96r:gtk-sharp helloworld.cs</x-tad-smaller></fontfamily></fixed>


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


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


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


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


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


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


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


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


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


<fixed><fontfamily><param>Courier New</param><x-tad-smaller>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-smaller></fontfamily></fixed>


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


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


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


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


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


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


<fixed><fontfamily><param>Courier =
New</param><x-tad-smaller>amrit@wayne.edu</x-tad-smaller></fontfamily></fi=
xed>


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

</excerpt></excerpt>=

--Apple-Mail-2--934812575--