Impressions during developing my first application with Mono and Gtk# (GtkSharp)
Why Mono? Why Gtk?
Over the past couple of years I have been developing C# ASP.NET enterprise applications. So I am quite comfortable with the Microsoft stack.
That answers the first question: Mono gives me C# and the .NET stack.
On the other hand I have been using linux as a desktop environment on my home machine for over a decade. I am comfortable with using linux as my primary OS.
That answers the second question: Mono gives me access to Gtk, the graphics library of gnome, which is the default “desktop” in many linux distributions.
The App
I want to synchronize different Git repositories semi-automatically using a Gui.
- Default behaviour of the automation can be loaded via a Json file.
- Each entry describes a repository set to be synchronized.
The app is located at https://github.com/draptik/RepoSync
I also published a small demo application for gtk# and treeview: https://github.com/draptik/GtkSharpTreeViewDemo
Impressions
Monodevelop vs Visual Studio
I’ll keep it brief: If you’re used to Visual Studio and ReSharper, Monodevelop does not come close. On the other hand Monodevelop is a full C# IDE which works with linux. And Monodevelop can be used cross-plattform.
Gtk# API
The Gtk# API is not your typical .NET library. You will very soon notice that the origins are C/C++. This takes some getting used to if you have a .NET background.
Typically there are no return values. Instead Gtk# methods very often use the “out” keyword in .NET because that comes closer to the C++ implementation using pointers.
Here is an example:
## Mono Gtk# Code
bool someBool = false;
if (listStore.GetIterFirst (out iter)) {
do {
someBool = (bool) listStore.GetValue (iter, 0);
} while (someBool && listStore.IterNext (ref iter));
}
return someBool;
## Pseudo-C# Code
return listStore.ToList().Any(s => s.MyBoolProp);
From the .NET side, I don’t like the Gtk# API. I prefer methods having return values. I guess it is a matter of tast. If it would really bother me, I would write some wrappers around… 😉
Archives
- July 2013 (1)
- December 2012 (1)
- October 2012 (1)
- September 2012 (1)
- August 2012 (1)
- March 2012 (1)
- February 2012 (2)
- November 2011 (1)
- October 2011 (1)
- September 2011 (1)
- July 2011 (2)
- May 2011 (2)
- April 2011 (1)
- March 2011 (2)
- January 2011 (1)
- December 2010 (1)
- November 2010 (1)
- August 2010 (1)
- June 2010 (1)
- April 2010 (1)
- January 2010 (1)
- December 2009 (1)
- October 2009 (1)
- July 2009 (2)
- June 2009 (5)
- May 2009 (6)
- April 2009 (6)
Recent Posts
Tag Cloud
9.04 access accessing auctex bash configuration conversion cygwin demo diff dotnet eclipse emacs exception ext3 facebook fat32 fraenkische schweiz git gtk gtktalog heap overflow hiking howto im increase memory instant messenger jaunty jackalone java junit keybindings keyboard shortcuts latex linux maven maven2 MAVEN_OPTS memory nhibernate nokia ntfs partition patch pidgin plugin pom pom.xml portable r rails rinari ruby ruby-on-rails screen shell skype software subversion surefire svn terminfo test tex texlive timezone truecrypt twitter ubuntu ubuntu 9.04 version control virtualbox visual studio vmware windows xmxTop Posts
- Moved my blog
- IT book recommendations
- Why I switched from Ubuntu to Arch Linux
- Impressions during developing my first application with Mono and Gtk# (GtkSharp)
- PS1 prompt
- GNU/Emacs: Desktop Save with "Lazy Loading"
- Converting a Mercurial repository to Git
- Converting a Subversion repository to Git
- NHibernate 3.2 Upgrades
- uNhAddIns patch for NHibernate 3.1
Pages
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Recent Comments