[Mono-list] HelloWorld.cs
Amrit Kohli
amrit@wayne.edu
Tue, 12 Oct 2004 21:35:29 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C4B0A3.65BCDB10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Nick,
=20
I tried to install GTK# but I haven=92t been able to. Do I have to =
actually
compile the GTK# source files? Is there an installable executable that =
I
can run which will properly install GTK# on my computer?
=20
I=92m running this on Windows 2000 with the .NET Service Pack 1 =
installed.
=20
Amrit
=20
----
Amrit Kohli
amrit@wayne.edu
=20
-----Original Message-----
From: mono-list-admin@lists.ximian.com
[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
=20
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 =
easy
question for most of you.
=20
I entered the following code from a HelloWorld type of application:
=20
// helloworld.cs - Gtk# Tutorial example
=20
namespace GtkSharpTutorial {
using Gtk;
using GtkSharp;
using System;
using System.Drawing;
=20
=20
public class helloworld {
=20
/* This is a callback function. The data arguments are =
ignored
* in this example. More on callbacks below. */
static void hello (object obj, EventArgs args)
{
Console.WriteLine("Hello World");
Application.Quit ();
}
=20
static void delete_event (object obj, DeleteEventArgs args)
{
/* If you return FALSE in the "delete_event" signal
handler,
* GTK will emit the "destroy" signal. Returning TRUE
means
* you don't want the window to be destroyed.
* This is useful for popping up 'are you sure you =
want to
quit?'
* type dialogs. */
=20
Console.WriteLine ("delete event occurred\n");
Application.Quit ();
}
=20
public static void Main(string[] args)
{
/* This is called in all GTK applications. Arguments =
are
parsed
* from the command line and are returned to the
application. */
Application.Init ();
=20
/* create a new window */
Window window =3D new Window ("helloworld");
/* When the window is given the "delete_event" signal
(this is given
* by the window manager, usually by the "close" =
option,
or on the
* titlebar), we ask it to call the delete_event ()
function
* as defined above. The data passed to the callback
* function is NULL and is ignored in the callback
function. */
=20
window.DeleteEvent +=3D new DeleteEventHandler
(delete_event);
=20
/* Sets the border width of the window. */
window.BorderWidth =3D 10;
/* gtk_container_set_border_width (GTK_CONTAINER
(window), 10);*/
=20
/* Creates a new button with the label "Hello World". =
*/
Button btn =3D new Button ("Hello World");
=20
/* When the button receives the "clicked" signal, it =
will
call the
* function hello() passing it NULL as its argument. =
The
hello()
* function is defined above. */
btn.Clicked +=3D new EventHandler (hello);
=20
=20
/* This packs the button into the window (a gtk
container). */
window.Add (btn);
=20
/* The final step is to display this newly created =
widget.
*/
window.ShowAll ();
=20
=20
/* All GTK applications must have a gtk_main(). =
Control
ends here
* and waits for an event to occur (like a key press or
* mouse event).
* In C#, we use Application.Run(), as used in
Windows.Forms*/
=20
Application.Run ();
=20
}
}
=20
}
=20
=20
When I tried to compile it, I got the following errors:
=20
helloworld.cs(20) error CS0246: Cannot find type `DeleteEventArgs'
helloworld.cs(4) error CS0246: The namespace `Gtk' can not be found =
(missing
assembly reference?)
Try using -r:gtk-sharp
helloworld.cs(5) error CS0246: The namespace `GtkSharp' can not be found
(missing assembly reference?)
Try using -r:gtk-sharp
helloworld.cs(7) error CS0246: The namespace `System.Drawing' can not be
found (missing assembly reference?)
Try using -r:System.Drawing
Compilation failed: 4 error(s), 0 warnings
=20
=20
So, I tried to do :
=20
=D8
=20
mcs =96r:gtk-sharp helloworld.cs
=20
That produced the error message:
=20
error CS0006: Cannot find assembly `gtk-sharp'
Log:
=20
Compilation failed: 1 error(s), 0 warnings
=20
=20
How do I install the GTK libraries? I am using mono v1.0.2 for windows.
I=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. Also, where =
would I
put the GTK libraries when I finally do install them?
=20
Thanks,
=20
Amrit
----
Amrit Kohli
amrit@wayne.edu
=20
------=_NextPart_000_0007_01C4B0A3.65BCDB10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
tt
{font-family:"Courier New";}
p.Quotation, li.Quotation, div.Quotation
{margin-top:6.0pt;
margin-right:.7in;
margin-bottom:6.0pt;
margin-left:.7in;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle19
{font-family:"Courier New";
color:blue;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:blue'>Nick,</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:blue'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:blue'>I tried =
to
install GTK# but I haven’t 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?</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:blue'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:blue'>I’m running this
on Windows 2000 with the .NET Service Pack 1 =
installed.</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:blue'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:blue'>Amrit</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:blue'> </span></font></p>
<div>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:blue'>----</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:blue'>Amrit =
Kohli</span></font></p>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:blue'>amrit@wayne.edu</span></font></p>
</div>
<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:blue'> </span></font></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original =
Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b>
mono-list-admin@lists.ximian.com =
[mailto:mono-list-admin@lists.ximian.com] <b><span
style=3D'font-weight:bold'>On Behalf Of </span></b>Nick Loeve<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Tuesday, October =
12, 2004
9:33 PM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> amrit@wayne.edu<br>
<b><span style=3D'font-weight:bold'>Cc:</span></b> =
mono-list@lists.ximian.com<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> Re: [Mono-list]
HelloWorld.cs</span></font></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'> </span></font></p>
<p class=3DMsoNormal =
style=3D'margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'>try
compiling with:<br>
<br>
msc -pkg:gtk-sharp helloworld.cs<br>
<br>
Thats assuming you have GTK# installed....<br>
<br>
<br>
On 13/10/2004, at 10:50 AM, Amrit Kohli wrote:</span></font></p>
<p class=3DMsoNormal style=3D'margin-left:.5in'><tt><?fontfamily><?param =
Courier New><?x-tad-bigger><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>I am =
still learning
mono and C#, so forgive me what is probably a very easy question for =
most of
you.</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>I entered the =
following code
from a HelloWorld type of =
application:</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>// helloworld.cs - =
Gtk# Tutorial
example</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>namespace =
GtkSharpTutorial {</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>
using Gtk;</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>
using GtkSharp;</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>
using System;</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>
using =
System.Drawing;</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>
public class helloworld =
{</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* This is a callback function. The data arguments are =
ignored</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* in this example. More on callbacks below. =
*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
static void hello (object obj, EventArgs =
args)</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
{</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
Console.WriteLine("Hello =
World");</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
Application.Quit =
();</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
}</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
static void delete_event (object obj, DeleteEventArgs =
args)</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
{</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* If you return FALSE in the "delete_event" signal =
handler,</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* GTK will emit the "destroy" signal. Returning TRUE =
means</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* you don't want the window to be =
destroyed.</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* This is useful for popping up 'are you sure you want to =
quit?'</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* type dialogs. =
*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
Console.WriteLine ("delete event =
occurred\n");</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
Application.Quit =
();</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
}</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
public static void Main(string[] =
args)</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
{</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* This is called in all GTK applications. Arguments are =
parsed</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* from the command line and are returned to the application. =
*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
Application.Init =
();</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* create a new window =
*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
Window window =3D new Window =
("helloworld");</span></font><?/x-tad-bigger><?/fontfamily></tt=
><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* When the window is given the "delete_event" signal (this is =
given</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* by the window manager, usually by the "close" option, =
or on
the</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* titlebar), we ask it to call the delete_event () =
function</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* as defined above. The data passed to the =
callback</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* function is NULL and is ignored in the callback function. =
*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
window.DeleteEvent +=3D new DeleteEventHandler =
(delete_event);</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigge=
r><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* Sets the border width of the window. =
*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
window.BorderWidth =3D =
10;</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* gtk_container_set_border_width (GTK_CONTAINER (window), =
10);*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigge=
r><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* Creates a new button with the label "Hello World". =
*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
Button btn =3D new Button ("Hello =
World");</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigge=
r><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* When the button receives the "clicked" signal, it will call =
the</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* function hello() passing it NULL as its argument. The =
hello()</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* function is defined above. =
*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
btn.Clicked +=3D new EventHandler =
(hello);</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></f=
ont><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* This packs the button into the window (a gtk container). =
*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
window.Add (btn);</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* The final step is to display this newly created widget. =
*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
window.ShowAll ();</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigge=
r><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
/* All GTK applications must have a gtk_main(). Control ends =
here</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* and waits for an event to occur (like a key press =
or</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* mouse event).</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
* In C#, we use Application.Run(), as used in =
Windows.Forms*/</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
Application.Run ();</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigge=
r><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> &nbs=
p;
}</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>
}</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>}</span></font><?/x-tad-bigger><?/fontfamily><=
/tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>When I tried to =
compile it, I
got the following =
errors:</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>helloworld.cs(20) =
error
CS0246: Cannot find type =
`DeleteEventArgs'</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>helloworld.cs(4) =
error
CS0246: The namespace `Gtk' can not be found (missing assembly =
reference?)</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'> =
Try using
-r:gtk-sharp</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>helloworld.cs(5) =
error
CS0246: The namespace `GtkSharp' can not be found (missing assembly =
reference?)</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'> =
Try using
-r:gtk-sharp</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>helloworld.cs(7) =
error
CS0246: The namespace `System.Drawing' can not be found (missing =
assembly
reference?)</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'> =
Try using =
-r:System.Drawing</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>Compilation =
failed: 4
error(s), 0 =
warnings</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>So, I tried to do =
:</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<?x-tad-bigger>=D8</p>
<?/x-tad-bigger>
<blockquote =
style=3D'margin-top:5.0pt;margin-bottom:5.0pt'><?fontfamily><?param =
Times New Roman><?smaller><?x-tad-smaller>
<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'> =
</span></font></p>
<?/x-tad-smaller><?/smaller><?/fontfamily></blockquote>
<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>
<p class=3DMsoNormal style=3D'margin-left:.5in'><tt><?fontfamily><?param =
Courier New><?x-tad-bigger><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>mcs =
–r:gtk-sharp
helloworld.cs</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>That produced the =
error
message:</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>error CS0006: =
Cannot find
assembly =
`gtk-sharp'</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>Log:</span></font><?/x-tad-bigger><?/fontfamil=
y></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>Compilation =
failed: 1 error(s),
0 warnings</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>How do I install =
the GTK
libraries? I am using mono v1.0.2 for windows. I’m =
guessing from
the little bit of research I’ve done that I have to compile the =
GTK# source
into an “assembly” or binary. Also, where would I put =
the GTK libraries
when I finally do install =
them?</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>Thanks,</span></font><?/x-tad-bigger><?/fontfa=
mily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>Amrit</span></font><?/x-tad-bigger><?/fontfami=
ly></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>----</span></font><?/x-tad-bigger><?/fontfamil=
y></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span style=3D'font-size:10.0pt'>Amrit =
Kohli</span></font><?/x-tad-bigger><?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'>amrit@wayne.edu</span></font><?/x-tad-bigger><=
?/fontfamily></tt><br>
<br>
<tt><?fontfamily><?param Courier New><?x-tad-bigger><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt'> </span></font><?/x-tad-bigger><?/fontfam=
ily></tt></p>
</blockquote>
</div>
</body>
</html>
------=_NextPart_000_0007_01C4B0A3.65BCDB10--