July 21, 2004 12:41 AM
Finally downloaded the RPMS of Mono for Fedora Core 2. The saddest part was that there were no instructions on which order to follow whilst installing the RPMS. They have to be installed in a particular order to satisfy the dependencies. This isn't much of a problem when you use yum or Red Carpet as they resolve and work out everything automatically. July's Linux For You Pro has an article about Mono and it suggested Red Carpet as well. I was stuck with 59 RPMS and no clue about the order of installation. Trying them out one by one seemed like fun but I wasn't that bored. I resorted to the following command that did get the job done.

rpm -Uvh *.rpm

rpm1 automatically figured out the order and installed mono-core and mono-develop without a hitch. For those whom this does not work, check www.gotmono.com for more details.

Mono is pretty impressive behind all the hype. Most of my old C# console programs were up and running with only a few modifications. Windows Forms support relies on Wine and is therefore imposed upon by the limitations that come with Wine. MonoDevelop is buggy and hey, why bother when we have GnuEmacs?

Here's a hello world sort of program I wrote in C# using GTK#:

using System;
using Gtk;

class MainClass {
  
  public static void Main(string[] args)
  {
    Application.Init ();
    Window win = new Window ("Gtk# in Action");
    win.SetDefaultSize (200, 200);
    win.DeleteEvent += delete_event;
    win.BorderWidth=20;
    //Create a button
    Button btn = new Button ("Click me");
    btn.Clicked += new EventHandler (clickhandler);
    //Create a box
    VBox box = new VBox(false, 0);
    box.BorderWidth =  2;
    Label label = new Label ("Hello World!");
    //Pack label and button
    box.PackStart(label, false, false, 3);
    box.PackStart(btn,false,false,3);
    win.Add (box);
    win.ShowAll ();
    Application.Run ();
  }
  
  static void delete_event (object obj, DeleteEventArgs args)
  {
    Console.WriteLine("Bye bye.");
    Application.Quit ();
  }
  
  static void clickhandler (object obj, EventArgs args)
  {
    Console.WriteLine("You clicked me!");
  }
}

This file can be compiled by the following command:

mcs hellow.cs -pkg:gtk-sharp

CategoryProgramming


[1] On a minor note, Checkinstall is a program worth checking out.

Copyright © 2004-2011 Anirudh Sasikumar. All rights reserved.
Last Updated: January 21, 2005 4:29 PM