Targeting Both .NET and Mono
Targeting Both .NET and Mono
In order to run MonoDevelop 2.2 on Windows, you need to first download and install GTK#, which is a set of .NET bindings for GTK+, the cross-platform open-source GUI tool popular on Linux and several other platforms. That installation is quick and painless, and once done, you then download and install MonoDevelop 2.2, which is also quick and painless. (You don't have to install Mono itself if you don't want to, in which case you'll be developing for .NET instead of Mono. Yup, you read that right.) And with MonoDevelop, you can target both Mono and the built-in Microsoft .NET framework. When you run your compiled program, there's a menu option that lets you choose which platform to run it under. To make this work, though, you need to download and install the complete Mono runtime, which is a separate download from MonoDevelop. (Otherwise you won't see multiple choices in the menu; you'll only see one for Microsoft .NET.)Nice Window Designer
The window designer is quite nice. Similar to Visual Studio and other RAD (rapid application development) tools such as Delphi, you have a window and a toolbox, and you can drag controls from the toolbox onto the window, and then set their properties. At the bottom of the source code window for window classes are two tabs, Source Code and Designer. Technically, these don't give you two different views of the same thing; rather, Designer is for layout, and Source Code is for accompanying code such as button event handlers. For some reason, by default, the Toolbox and Properties windows weren't present when I opened Designer. But they were easy to find under the View menu. And if you're coming from a Visual Studio background, you might be a little startled to be working in GTK# instead of the usual WinForms world of Visual Studio. With MonoDevelop, by default your windowing applications target GTK#, and so the toolbox is arranged accordingly. The layout mechanism works as per GTK# rules. You can't just drop a button on the form; first you have to drop a layout and then drop your controls. And similarly, when you want to create, for example, a button handler, you don't double-click the button on the form (nothing happens). Instead, you go to the Properties window and click the Signals tab. (In the GTK world, you use signals, which are effectively the same as events.) But this is easy: You just double-click the event-er, I mean signal-name, and Designer will switch to your code view and automatically insert a handler function for you that you can fill in with your own code. But if you're watching closely, you might wonder something regarding GTK# and the .NET framework. I mentioned that ultimately you're building a .NET executable that contains .NET startup code and compiled bytecode. But what if you're using GTK#? That's not automatically part of .NET, right? Correct, but you're fine. GTK# can run under .NET as well as Mono. And that means your compiled GTK# GUI application can run under either .NET or Mono. Of course, that does introduce a caveat: If you plan to deploy your GUI application, the target machine needs to have GTK# installed. (I'd like to petition Microsoft to ship GTK# with all Windows machines. One can dream.)







