22 August 2010

I CAN HAZ MONO

To partially cure my boredom, I downloaded the Mono framework, a piece of software that allows cross platform programs to be written in Microsoft's C#. Installation was decently straightforward; install the program from an installer in a disk image and you are ready to code. For some reason, the GUI toolkits did not install correctly (but they are on my hard disk), and because I did not look into the problem, I was not able to play with GUI-based applications. Maybe everything will install correctly on my Linux box. I will finally get to use it tomorrow when I go to Massachusetts!

Here is the basic Hello World program:

using System;


public class HelloWorld
{
static public void Main()
{
Console.WriteLine("Hello MonoWorld!");
}
}

But the WinForms and GTK# based GUI applications failed to compile, sadly.

WinForms:

using System;
using System.Windows.Forms;


public class HelloWorld : Form
{
static public void Main()
{
Application.Run(new HelloWorld());
}
public HelloWorld()
{
Text = "Hello MonoWorld";
}
}

GTK#:

using Gtk;
using System;


class Hello
{
static void Main()
{
Application.Init();
Window window = new Window("hi");
window.Show();
Application.Run();
}
}

Feedback on my first C# post: Interestingly, I received quite a bit of feedback on my journey with C# all on Buzz. It evolved into quite an interesting thread. [Link]

And finally, here is a bit of programming/compsci humor:


Nope, I do not have mono(nucleosis). :P

No comments:

Post a Comment