<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Martijn's C# Programming Blog &#187; mono</title>
	<atom:link href="http://www.dijksterhuis.org/tag/mono/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dijksterhuis.org</link>
	<description>Information, news about programming in C#</description>
	<lastBuildDate>Fri, 07 Aug 2009 21:26:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using the Moonlight plugin to watch a little Silverlight</title>
		<link>http://www.dijksterhuis.org/moonlight-plugin-watch-silverlight/</link>
		<comments>http://www.dijksterhuis.org/moonlight-plugin-watch-silverlight/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 05:14:17 +0000</pubDate>
		<dc:creator>Martijn</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[moonlight]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=471</guid>
		<description><![CDATA[
In early December 2008 Moonlight 1.0 beta was released by the Mono team, making it possible to run  basic Silverlight 1.0 applications from your Linux Firefox installation. If you are like me mostly working on a Linux workstation, then its likely that you have seen little so far of the Microsoft Silverlight platform. The best [...]<p>This is a post from <a href="http://www.dijksterhuis.org">Martijn's C# Coding Blog</a>. </p>
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-475" title="Using Moonlight to watch Silverlight" src="http://www.dijksterhuis.org/wp-content/uploads/2009/01/moon.png" alt="Using Moonlight to watch Silverlight" width="500" height="324" /></p>
<p><em>In early December 2008 <a id="qiy-" title="Moonlight 1.0 beta was released by the Mono team" href="http://tirania.org/blog/archive/2008/Dec-02-1.html">Moonlight 1.0 beta was released by the Mono team</a>, making it possible to run  basic Silverlight 1.0 applications from your Linux Firefox installation. </em><em>If you are like me mostly working on a Linux workstation, then its likely that you have seen little so far of the Microsoft Silverlight platform. The best way to think of Silverlight 1.0 is as Flash, but then by Microsoft. Similar to Flash, Silverlight installs as a web browser plugin and provides animation, graphics and audio/video. The next generation (Silverlight 2.0) includes support for running C# managed code from the plugin which should make things quite interesting.</em></p>
<p><span id="more-471"></span><br />
<strong>What is Moonlight?</strong></p>
<p>Moonlight is an Open Source implementation by Novell and the Mono team of  Microsoft Silverlight. It was born out of a 21 day hacking session by the Mono team in early 2007. This was  possible as much code needed for building Moonlight was already implemented by the Mono team for their C# libraries. Cleaning things up took them a little longer and the first beta was released in December 2008.</p>
<p>Currently Moonlight implements Silverlight 1.0, but work on Silverlight 2.0 has already been started. The <a id="xln7" title="Moonlight roadmap shows" href="http://www.mono-project.com/MoonlightRoadmap">Moonlight roadmap shows</a> that we will have to wait a little longer for that though, the first alpha is not planned until April 2009.  Moonlight 2.0 is where things will become really interesting as it will contain a mono implementation allowing you to execute C# or Dynamic Language Runtime based languages.</p>
<p><strong>Installing Moonlight</strong><em><br />
</em></p>
<ol>
<li>You can install Moonlight 1.0 for Firefox from <a id="q4_e" title="http://www.go-mono.com/moonlight/" href="http://www.go-mono.com/moonlight/">http://www.go-mono.com/moonlight/</a></li>
<li>If you come across a website that requires video codecs, Moonlight will offer to install the Microsoft codecs for playback.</li>
</ol>
<p><strong>Testing if things work</strong></p>
<p>Enough dry stuff &#8212; I am not expecting miracles from a beta release, but it would of course be nice if somethings do actually work. For some examples have a look at the Moonlight status page of scripts that they have tested their plug-in against:</p>
<ul>
<li><a id="f0vx" title="http://go-mono.com/moonlight/MoonlightStatus.aspx" href="http://go-mono.com/moonlight/MoonlightStatus.aspx">http://go-mono.com/moonlight/MoonlightStatus.aspx</a></li>
</ul>
<p><strong>Troubleshooting</strong></p>
<p>Not all websites detect Silverlight 1.0 properly, so if you come across a website saying &#8220;Silverlight 1.0 not found&#8221; you migth need a bit of work. A little GreaseMonkey script can help out here as explained on the <a id="luer" title="MoonLight Quirks page" href="http://mono-project.com/MoonlightQuirks#GreaseMonkey">MoonLight Quirks page</a>.</p>
<p><strong>Video codecs and legal issues</strong></p>
<p>Through an agreement between Novell and Microsoft it is possible to legally use the Microsoft Codecs for decoding audio and video streams, but only if you download the Moonlight beta&#8217;s directly from Novell. As an alternative it should  be possible to compile the Moonlight from source against the open source FFMPEG libraries as <a id="exh0" title="mentioned by Miguel de Icaza on his blog" href="http://tirania.org/blog/archive/2007/Sep-05.html">mentioned by Miguel de Icaza on his blog</a>: &#8220;<em>Currently Moonlight video support has been prototyped using the fabulous and LGPLed ffmpeg engine for video and audio. We are unable to redistribute this code commercially due to licensing conflicts. Update: This means that individuals that want to use a 100% pure free software setup can do so. We are unable to redistribute this edition though. &#8220;</em></p>
<p><em>Image credit: Moonlight by <a rel="nofollow" href="http://www.flickr.com/photos/jamesjordan/">James Jordan</a></em></p>
<p>This is a post from <a href="http://www.dijksterhuis.org">Martijn's C# Coding Blog</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dijksterhuis.org/moonlight-plugin-watch-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a GTK notification area icon using Mono and C#</title>
		<link>http://www.dijksterhuis.org/creating-gtk-notification-area-icon-mono/</link>
		<comments>http://www.dijksterhuis.org/creating-gtk-notification-area-icon-mono/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 08:14:59 +0000</pubDate>
		<dc:creator>Martijn</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[GTK]]></category>
		<category><![CDATA[Learn C#]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[StatusIcon]]></category>
		<category><![CDATA[Tooltip]]></category>

		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=435</guid>
		<description><![CDATA[
Cool (Linux) applications have their own icon in the notification area. To add my own icon in the Gnome notification area using Mono only took a few lines of code. In the post below I show how you can add your icon and associate a tooltip and right click menu to it.

GTK provides the StatusIcon [...]<p>This is a post from <a href="http://www.dijksterhuis.org">Martijn's C# Coding Blog</a>. </p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dijksterhuis.org/wp-content/uploads/2009/01/tooltip.png"><img src="http://www.dijksterhuis.org/wp-content/uploads/2009/01/tooltip.png" alt="Adding a Gnome tooltip to your application with C# and Mono" title="Adding a Gnome tooltip to your application with C# and Mono" width="500" height="57" class="alignnone size-full wp-image-436" /></a></p>
<p><em>Cool (Linux) applications have their own icon in the notification area. To add my own icon in the Gnome notification area using Mono only took a few lines of code. In the post below I show how you can add your icon and associate a tooltip and right click menu to it.</em></p>
<p><span id="more-435"></span></p>
<p>GTK provides the <em>StatusIcon</em> class to register your own icon in the notification area.</p>
<pre class="brush: c#">
    StatusIcon  myStatusIcon;
</pre>
<p>You can provide and load your own icon, but for this example I used one of the GTK stock icons.</p>
<pre class="brush: c#">
     myStatusIcon = StatusIcon.NewFromStock(Stock.Harddisk);  // I use a stock icon from Stock.*
                                                                                          // to avoid having to include an icon file
     myStatusIcon.Visible = true;                                             // Make sure we are displayed
</pre>
<p>Adding or changing a tooltip is as straighforward as assigning it:</p>
<pre class="brush: c#">
      myStatusIcon.Tooltip = &quot;Hello World ToolTip&quot;;                      // The message to show when the mouse hovers over the icon
</pre>
<p>To create a rightclick menu we need to register the PopupMenu event handler:</p>
<pre class="brush: c#">
     myStatusIcon.PopupMenu += OnStatusIconPopupMenu;         // Link in the right click popup menu
     ...
     ...

    /* The Status Popup menu is shown when the user right clicks on the toolbar icon */

    protected void OnStatusIconPopupMenu(object sender, EventArgs e)
    {
        Menu popupMenu = new Menu();

        MenuItem helloItem = new MenuItem(&quot;About Hello World&quot;);
        helloItem.Show();
        helloItem.Activated += new EventHandler(OnHelloAboutActivated);

        popupMenu.Append(helloItem);
        popupMenu.Popup(null,null,null,3,Gtk.Global.CurrentEventTime);
    }
</pre>
<p>And that is really all there is to it. I have included the complete code below. If you create a new GTK solution in MonoDevelop you will end up with two files, Main.cs and MainWindows.Cs. Replace the MainWindow.CS file with the content below: </p>
<pre class="brush: c#">

using System;
using Gtk;

public partial class MainWindow: Gtk.Window
{
	StatusIcon  myStatusIcon;
	AboutDialog aboutDialog;

	public MainWindow (): base (Gtk.WindowType.Toplevel)
	{

		/* The following lines create the notification area status icon */
		/* Make it visible and link in the right click popup menu       */ 

		myStatusIcon = StatusIcon.NewFromStock(Stock.Harddisk);  // I use a stock icon from Stock.*
		                                                         // to avoid having to include an icon file
		myStatusIcon.Tooltip = &quot;Hello World ToolTip&quot;;            // The message to show when the mouse hovers over the icon
		myStatusIcon.Visible = true;                             // Make sure we are displayed
		myStatusIcon.PopupMenu += OnStatusIconPopupMenu;         // Link in the right click popup menu 

		/* Not necessary */
		Label AppWindowLabel = new Label(&quot;Hello World&quot;);
		this.Add(AppWindowLabel);

		Build ();
	}

	/* Called when the main application closes */

	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
	{
		Application.Quit ();
		a.RetVal = true;
	}

	/* The Status Popup menu is shown when the user right clicks on the toolbar icon */

	protected void OnStatusIconPopupMenu(object sender, EventArgs e)
	{
		Menu popupMenu = new Menu();

		MenuItem helloItem = new MenuItem(&quot;About Hello World&quot;);
		helloItem.Show();
		helloItem.Activated += new EventHandler(OnHelloAboutActivated);

		popupMenu.Append(helloItem);
		popupMenu.Popup(null,null,null,3,Gtk.Global.CurrentEventTime);
	}

	/* If the user select the &quot;About Hello World&quot; menu option, we show the about dialog */

	protected void OnHelloAboutActivated(object sender, EventArgs e)
	{
		aboutDialog = new AboutDialog();

		aboutDialog.ProgramName = &quot;The About Dialog Popup Demo&quot;;
		aboutDialog.Version = &quot;1.0beta&quot;;
		aboutDialog.Comments = &quot;The best things in life are simple!&quot;;
		aboutDialog.License = &quot;Creative Commons&quot;;
		aboutDialog.Authors = new string[] { &quot;Martijn Dijksterhuis&quot; };
		aboutDialog.Website = &quot;http://www.dijksterhuis.org&quot;;
		aboutDialog.Response += new ResponseHandler(OnHelloAboutClose);

		aboutDialog.Run();
	}

	/* Catch the &quot;Close&quot; and &quot;X&quot; button event from the about dialog box */

	protected void OnHelloAboutClose(object sender, ResponseArgs e)
	{
		if (e.ResponseId==ResponseType.Cancel || e.ResponseId==ResponseType.DeleteEvent)
		 aboutDialog.Destroy();
	}

}
</pre>
<p>This is a post from <a href="http://www.dijksterhuis.org">Martijn's C# Coding Blog</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dijksterhuis.org/creating-gtk-notification-area-icon-mono/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Mono 2.0.1 on Ubuntu</title>
		<link>http://www.dijksterhuis.org/using-mono-201-on-ubuntu/</link>
		<comments>http://www.dijksterhuis.org/using-mono-201-on-ubuntu/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 09:01:45 +0000</pubDate>
		<dc:creator>Martijn</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Learn C#]]></category>
		<category><![CDATA[2.01]]></category>
		<category><![CDATA[mono]]></category>

		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=210</guid>
		<description><![CDATA[
Although Mono 2.0.1 has been out for some time now it will take another major upgrade for Ubuntu to actually include it. Currently Ubuntu includes Mono 1.2.6.  
If you would like to work with the newer Mono version you need to compile it yourself for now. Thankfully this is easier than it sounds. The [...]<p>This is a post from <a href="http://www.dijksterhuis.org">Martijn's C# Coding Blog</a>. </p>
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.dijksterhuis.org/wp-content/uploads/2008/11/screenshot1.png" alt="Using Mono 2.0.1 on Ubuntu" title="Using Mono 2.0.1 on Ubuntu" width="500" height="138" class="alignnone size-full wp-image-212" /></p>
<p>Although Mono 2.0.1 has been out for some time now it will take another major upgrade for Ubuntu to actually include it. Currently Ubuntu includes Mono 1.2.6.  </p>
<p>If you would like to work with the newer Mono version you need to compile it yourself for now. Thankfully this is easier than it sounds. The following will upgrade your Ubuntu installation but note: this does not cover MonoDevelop, which will stay at the old version. </p>
<p><span id="more-210"></span></p>
<p>To prepare for the compilation you need to install the following packages: </p>
<blockquote><p>sudo apt-get install build-essential swig autoconf bison gawk mono-common binfmt-support libgtk2.0-dev</p></blockquote>
<p>Once you are done, download and unpack the source for Mono. This will get you 2.0.1:</p>
<blockquote><p>wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.0.1.tar.bz2<br />
tar xf mono-2.0.1.tar.bz2</p></blockquote>
<p>Now compile and install mono as below. If anything major is missing on your system <em>configure</em> will give a warning. The make phase will take a bit of time. </p>
<blockquote><p>cd mono-2.0.1<br />
./configure &#8211;with-libgdiplus=no<br />
make<br />
make install</p></blockquote>
<p>To make sure that your Mono build executables can be run directly from the command line you need to add one more symbolic link: </p>
<blockquote><p>ln -s /usr/local/bin/mono /etc/alternatives/cli</p></blockquote>
<p>This is a post from <a href="http://www.dijksterhuis.org">Martijn's C# Coding Blog</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dijksterhuis.org/using-mono-201-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
