Hi all, I've just been reading around a little in the handbook, and coming across the "Fast Cross-platform GUI" section, felt an urge to correct it a little. No offense Johannes, but there's some typos in there :-)
Apologies for not sending a .diff; I'm at work and there's no Diff tool here. - Raphael P.S.: It appears I've still Gtk.Label and Gtk.Misc under my claim. Pretending that I will get to work on them anytime soon doesn't help a thing, I probably won't. So if nobody else has done them meanwhile -- they're free again. -- Raphael Schmid Martin-Luther-Strasse 26 72224 Ebhausen GERMANY [EMAIL PROTECTED] Home: +49 (0) 7458-455289 On Site: +49 (0) 7452-808114 Mobile: +49 (0) 173-8757046 NIETS IS ONMOGELIJKTitle: The Mono Handbook - Cross platform applications with mono
Fast Cross-platform GUI
by Johannes Roith ([EMAIL PROTECTED])I. Your options
When it comes to GUI, the .NET Framework shows its side that makes code unportable. Microsoft does offer one toolkit, called System.Windows.Forms. It's based on the Windows APIs, which make it look native. Mono is implementing it for compatiblity reasons, but the implementation is based on Wine, an Open Source implementation of the Windows API on top of X and Unix, and has several disadvantages. First, such an application can be executed with mono but needs a special command which embeds Wine. It integrates badly with the rest of the system on operating systems other than Windows and certainly will not be ported to all platforms.Secondly, and that's even more of a reason, it is not very powerful. While Windows programmer might be used to that, it does - unlike both Linux desktop's GUI toolkits - fixes widgets with coordinates on the form. Gtk#/Qt# are using an intelligent boxing-system where the user can resize the form and all widgets will resize as well. Internationalization is much easier that way, because if the text doesn't fit in the room the box is automatically grown.
The way Java does it, is called Swing. Swing looks consistently (ugly, but your mileage may vary) across all platforms. And it is slow. Very slow. In fact that's one of the reasons why people think Java is slow in general. But we have better options. There are two GUI toolkits out there, one used by KDE desktop, one by GNOME. Both are ported to Windows and MacOS X. GTK+, the GNOME toolkit is even ported to BeOS. Gtk# (the C# binding to Gtk) is very fast, currently Qt# is even faster. In any case, both are much faster than Swing.
So, what GUI to take? My personal favorite is Gtk#. Why? The Windows and MacOS X versions of Qt are not free, currently. The developers are working on porting the X11 code to Windows. But by the time of this writing, it is not done. Besides that I'm a GNOME fan, and more used to the GTK+ toolkit.
II. Learning about things
The Mono Handbook has a big section GNOME.NET. Not all of GNOME is multiplatform. But we have clearly marked, what is. The portable part is:
- Gtk# - Widgets & Co.
- Gdk# - Drawin
- Pango# - 1st class internationalisation support
- Atk# - accessiblity support for people with disablities
- Glade# - Forms, based on XML, that can be changed dynamically
- Glade Interface Builder - Tools to easily create Glade XML files.
