[Mono-list] HelloWorld.cs

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


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

Amrit,

try http://www.mono-project.com/downloads/

The windows installer includes GTK#



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

> Nick,
>
> =A0
>
> I tried to install GTK# but I haven=92t been able to.=A0 Do I have to=20=

> actually compile the GTK# source files?=A0 Is there an installable=20
> executable that I can run which will properly install GTK# on my=20
> computer?
>
> =A0
>
> I=92m running this on Windows 2000 with the .NET Service Pack 1=20
> installed.
>
> =A0
>
> Amrit
>
> =A0
>
> ----
>
> Amrit Kohli
>
> amrit@wayne.edu
>
> =A0
>
> -----Original Message-----
> From: mono-list-admin@lists.ximian.com=20
> [mailto:mono-list-admin@lists.ximian.com] On Behalf Of Nick Loeve
> Sent: Tuesday, October 12, 2004 9:33 PM
> To: amrit@wayne.edu
> Cc: mono-list@lists.ximian.com
> Subject: Re: [Mono-list] HelloWorld.cs
>
> =A0
>
> 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-9--912891373
Content-Transfer-Encoding: quoted-printable
Content-Type: text/enriched;
	charset=WINDOWS-1252

Amrit,


try http://www.mono-project.com/downloads/


The windows installer includes GTK#




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


<excerpt><fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>Nick,</x-tad=
-smaller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>=A0</x-tad-s=
maller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>I
tried to install GTK# but I haven=92t been able to.=A0 Do I have to
actually compile the GTK# source files?=A0 Is there an installable
executable that I can run which will properly install GTK# on my
computer?</x-tad-smaller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>=A0</x-tad-s=
maller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>I=92m
running this on Windows 2000 with the .NET Service Pack 1 =
installed.</x-tad-smaller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>=A0</x-tad-s=
maller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>Amrit</x-tad=
-smaller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>=A0</x-tad-s=
maller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>----</x-tad-=
smaller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>Amrit
Kohli</x-tad-smaller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>amrit@wayne.=
edu</x-tad-smaller></color></fontfamily></fixed>


<fixed><fontfamily><param>Courier =
New</param><color><param>0000,0000,FFFE</param><x-tad-smaller>=A0</x-tad-s=
maller></color></fontfamily></fixed>


<x-tad-bigger>-----Original Message-----</x-tad-bigger>

<bold><x-tad-bigger>From:</x-tad-bigger></bold><x-tad-bigger>
mono-list-admin@lists.ximian.com
[mailto:mono-list-admin@lists.ximian.com]
</x-tad-bigger><bold><x-tad-bigger>On Behalf Of
</x-tad-bigger></bold><x-tad-bigger>Nick Loeve</x-tad-bigger>

<bold><x-tad-bigger>Sent:</x-tad-bigger></bold><x-tad-bigger> Tuesday,
October 12, 2004 9:33 PM</x-tad-bigger>

<bold><x-tad-bigger>To:</x-tad-bigger></bold><x-tad-bigger>
amrit@wayne.edu</x-tad-bigger>

<bold><x-tad-bigger>Cc:</x-tad-bigger></bold><x-tad-bigger>
mono-list@lists.ximian.com</x-tad-bigger>

<bold><x-tad-bigger>Subject:</x-tad-bigger></bold><x-tad-bigger> Re:
[Mono-list] HelloWorld.cs</x-tad-bigger>


<fontfamily><param>Times New =
Roman</param><bigger><bigger>=A0</bigger></bigger></fontfamily>


<fontfamily><param>Times New Roman</param><bigger><bigger>try
compiling with:</bigger></bigger></fontfamily>


<fontfamily><param>Times New Roman</param><bigger><bigger> msc
-pkg:gtk-sharp helloworld.cs</bigger></bigger></fontfamily>


<fontfamily><param>Times New Roman</param><bigger><bigger> Thats
assuming you have GTK# installed....</bigger></bigger></fontfamily>



<fontfamily><param>Times New Roman</param><bigger><bigger> On
13/10/2004, at 10:50 AM, Amrit Kohli =
wrote:</bigger></bigger></fontfamily>


<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>


<fontfamily><param>Times New Roman</param><bigger><bigger> =
=D8</bigger></bigger></fontfamily>


<fontfamily><param>Times New =
Roman</param><bigger><bigger>=A0=A0=A0=A0=A0=A0</bigger></bigger></fontfam=
ily>


<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>=

--Apple-Mail-9--912891373--