Amrit,

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

The windows installer includes GTK#



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

<x-tad-smaller>Nick,</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>I tried to install GTK# but I haven’t 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?</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>I’m running this on Windows 2000 with the .NET Service Pack 1 installed.</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>Amrit</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>----</x-tad-smaller>

<x-tad-smaller>Amrit Kohli</x-tad-smaller>

<x-tad-smaller>[EMAIL PROTECTED]</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-bigger>-----Original Message-----</x-tad-bigger>
<x-tad-bigger>From:</x-tad-bigger><x-tad-bigger> [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] </x-tad-bigger><x-tad-bigger>On Behalf Of </x-tad-bigger><x-tad-bigger>Nick Loeve</x-tad-bigger>
<x-tad-bigger>Sent:</x-tad-bigger><x-tad-bigger> Tuesday, October 12, 2004 9:33 PM</x-tad-bigger>
<x-tad-bigger>To:</x-tad-bigger><x-tad-bigger> [EMAIL PROTECTED]</x-tad-bigger>
<x-tad-bigger>Cc:</x-tad-bigger><x-tad-bigger> [EMAIL PROTECTED]</x-tad-bigger>
<x-tad-bigger>Subject:</x-tad-bigger><x-tad-bigger> Re: [Mono-list] HelloWorld.cs</x-tad-bigger>

 

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:

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

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>I entered the following code from a HelloWorld type of application:</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>// helloworld.cs - Gtk# Tutorial example</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>namespace GtkSharpTutorial {</x-tad-smaller>

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

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

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

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

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

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

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>            /* This is a callback function. The data arguments are ignored</x-tad-smaller>

<x-tad-smaller>             * in this example. More on callbacks below. */</x-tad-smaller>

<x-tad-smaller>            static void hello (object obj, EventArgs args)</x-tad-smaller>

<x-tad-smaller>            {</x-tad-smaller>

<x-tad-smaller>                  Console.WriteLine("Hello World");</x-tad-smaller>

<x-tad-smaller>                  Application.Quit ();</x-tad-smaller>

<x-tad-smaller>            }</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>            static void delete_event (object obj, DeleteEventArgs args)</x-tad-smaller>

<x-tad-smaller>            {</x-tad-smaller>

<x-tad-smaller>                  /* If you return FALSE in the "delete_event" signal handler,</x-tad-smaller>

<x-tad-smaller>                   * GTK will emit the "destroy" signal. Returning TRUE means</x-tad-smaller>

<x-tad-smaller>                   * you don't want the window to be destroyed.</x-tad-smaller>

<x-tad-smaller>                   * This is useful for popping up 'are you sure you want to quit?'</x-tad-smaller>

<x-tad-smaller>                   * type dialogs. */</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>                      Console.WriteLine ("delete event occurred\n");</x-tad-smaller>

<x-tad-smaller>                      Application.Quit ();</x-tad-smaller>

<x-tad-smaller>            }</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>            public static void Main(string[] args)</x-tad-smaller>

<x-tad-smaller>            {</x-tad-smaller>

<x-tad-smaller>                  /* This is called in all GTK applications. Arguments are parsed</x-tad-smaller>

<x-tad-smaller>                   * from the command line and are returned to the application. */</x-tad-smaller>

<x-tad-smaller>                  Application.Init ();</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>                  /* create a new window */</x-tad-smaller>

<x-tad-smaller>                  Window window = new Window ("helloworld");</x-tad-smaller>

<x-tad-smaller>                  /* When the window is given the "delete_event" signal (this is given</x-tad-smaller>

<x-tad-smaller>                   * by the window manager, usually by the "close" option, or on the</x-tad-smaller>

<x-tad-smaller>                   * titlebar), we ask it to call the delete_event () function</x-tad-smaller>

<x-tad-smaller>                   * as defined above. The data passed to the callback</x-tad-smaller>

<x-tad-smaller>                   * function is NULL and is ignored in the callback function. */</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>                  window.DeleteEvent += new DeleteEventHandler (delete_event);</x-tad-smaller>

<x-tad-smaller>   </x-tad-smaller>

<x-tad-smaller>                  /* Sets the border width of the window. */</x-tad-smaller>

<x-tad-smaller>                  window.BorderWidth = 10;</x-tad-smaller>

<x-tad-smaller>                  /*  gtk_container_set_border_width (GTK_CONTAINER (window), 10);*/</x-tad-smaller>

<x-tad-smaller>   </x-tad-smaller>

<x-tad-smaller>                  /* Creates a new button with the label "Hello World". */</x-tad-smaller>

<x-tad-smaller>                  Button btn = new Button ("Hello World");</x-tad-smaller>

<x-tad-smaller>   </x-tad-smaller>

<x-tad-smaller>                  /* When the button receives the "clicked" signal, it will call the</x-tad-smaller>

<x-tad-smaller>                   * function hello() passing it NULL as its argument.  The hello()</x-tad-smaller>

<x-tad-smaller>                   * function is defined above. */</x-tad-smaller>

<x-tad-smaller>                  btn.Clicked += new EventHandler (hello);</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>      </x-tad-smaller>

<x-tad-smaller>                  /* This packs the button into the window (a gtk container). */</x-tad-smaller>

<x-tad-smaller>                  window.Add (btn);</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>                  /* The final step is to display this newly created widget. */</x-tad-smaller>

<x-tad-smaller>                  window.ShowAll ();</x-tad-smaller>

<x-tad-smaller>   </x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

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

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

<x-tad-smaller>                  * mouse event).</x-tad-smaller>

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

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>                  Application.Run ();</x-tad-smaller>

<x-tad-smaller>   </x-tad-smaller>

<x-tad-smaller>                  }</x-tad-smaller>

<x-tad-smaller>      }</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>}</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>When I tried to compile it, I got the following errors:</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>helloworld.cs(20) error CS0246: Cannot find type `DeleteEventArgs'</x-tad-smaller>

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

<x-tad-smaller>    Try using -r:gtk-sharp</x-tad-smaller>

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

<x-tad-smaller>    Try using -r:gtk-sharp</x-tad-smaller>

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

<x-tad-smaller>    Try using -r:System.Drawing</x-tad-smaller>

<x-tad-smaller>Compilation failed: 4 error(s), 0 warnings</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>So, I tried to do :</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

Ø

      

<x-tad-smaller>mcs –r:gtk-sharp helloworld.cs</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>That produced the error message:</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>error CS0006: Cannot find assembly `gtk-sharp'</x-tad-smaller>

<x-tad-smaller>Log:</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>Compilation failed: 1 error(s), 0 warnings</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>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?</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>Thanks,</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

<x-tad-smaller>Amrit</x-tad-smaller>

<x-tad-smaller>----</x-tad-smaller>

<x-tad-smaller>Amrit Kohli</x-tad-smaller>

<x-tad-smaller>[EMAIL PROTECTED]</x-tad-smaller>

<x-tad-smaller> </x-tad-smaller>

Reply via email to