3

I am new to programming and I am interested in developing applications in C# using Mono. I would like to choose a GUI framework other than GTK+: either WinForms or XWT (https://github.com/mono/xwt).

Is there a designer to design WinForms GUIs? What about one for XWT? I am using MonoDevelop as my IDE.

If there is no designers for either WinForms or XWT, do you think it possible to write the application in C# in .NET with WinForms using Visual Studio 2012 and just compile it using Mono when I want to deploy?

user2370738
  • 31
  • 2
  • 5
  • Why the aversion to gtk#? – ruffin May 11 '13 at 15:11
  • You can certainly write apps using the WinForms designers in either Visual Studio or SharpDevelop and then just build the resulting project using either MonoDevelop or xbuild. You do not need the designer to compile WinForms apps in Mono. – Justin Jun 14 '13 at 03:54

2 Answers2

5

That's probably two questions.

1.) What are my Mono GUI RAD options?

If you want a Mono GUI RAD your only choice is GTK# as far as I know.

If you want a GUI RAD for Windows.Forms, it's called Visual Studio (or potentially VS Express for Desktop in Win8) and requires Windows/working outside of MonoDevelop. ;) On the plus side, it's a really good GUI RAD.

2.) What GUI framework is best for writing once and running everywhere?

Gtk#. Unfortunately, Mono's Windows.Forms doesn't work well and is a dead end tech. See here for a similar question.

As I mention in an answer there, if you want to write a utility that targets multiple OSes in Mono (or you're Linux-centric), you probably do want Gtk#. If you want to create a traditional client app, prepare to rewrite your GUI on each target platform.

Edit: Less nepotistic question on a similar subject here.

Edit2: There is a Mono WinForms designer that I forgot about here, but its description readily admits that, "Unfortunately the designer is not ready yet for proper use," and the blocking bug they refer to is from 2007, so not much help.

Good luck!

Community
  • 1
  • 1
ruffin
  • 16,507
  • 9
  • 88
  • 138
  • "Unfortunately, Mono's Windows.Forms doesn't work well and is a dead end tech." is not 100% true. There are significant compatibility issues, but some apps do run fine on Mono WinForms (even commercial ones). – Lex Li May 13 '13 at 03:25
  • "Dead end" to me means "no longer actively developed," which, when I've been on [Mono's IRC channels](http://www.mono-project.com/IRC), and the very quiet [WinForms bugs list](https://bugzilla.xamarin.com/buglist.cgi?product=Class%20Libraries&component=Windows.Forms&resolution=---), does seem to be the case. Much of it works, but it's buggy, and in my experience, *very* buggy very quickly, requiring ugly codearonds. Do you have a good crossplatform WinForm apps you could give as an example? [Banshee](http://banshee.fm/), eg, is a great Gtk# app; would love to see a WinForms Mono equivalent. – ruffin May 13 '13 at 13:41
  • [JArchitect](http://jarchitect.com). Since Banshee is ugly on Windows, I don't think it is a good example. – Lex Li May 13 '13 at 23:14
  • @ruffin - I believe that [Plastic](http://www.plasticscm.com/gallery.html) is Windows Forms based (or at least was at one time) – Justin May 06 '14 at 15:27
  • @LexLi -- Fwiw, CodeGears (who make JArchitect) [aren't using WinForms now](http://www.codergears.com/Blog/?p=90): `In our first version we used the Mono Winforms implementation to avoid big changes on our code base... After contacting some Objective C developers... we discoverd our big mistake... We decided for our second version to use MonoMac and **remove all dependencies with System.Windows.Forms and System.Drawing libraries to use Cocoa instead**.` I'm still going to suggest GTK# for xplat out of the box, and, as CodeGears found, native UI forks for each platform for "serious" apps. – ruffin Jan 12 '15 at 15:35
  • It's a comment in 2013, and things do change heavily now. Mono/Xamarin is moving fast on mobile, slow on server side, and almost dead on desktop. Thus, Mono's WinForms is now marked as obsolete officially, and should be avoided in all kinds of projects. `System.Drawing` should still be safe to use, but of course when you target OS X there are better alternatives. – Lex Li Jan 13 '15 at 12:22
4

Looking at current direction of mono who driven by Xamarin, they promotes the native UI for each platform. means you writing business process as separate project and GUI for each target platform. as for desktop, using XWT is preferable as you will uses similar API to access native UI in each platform, without loosing ability to add more advance UI for each platform.

XWT API is based on GTK# API (easy for Xamarin folks to migrate their existing apps), and provides with lot of common widget/control which implemented for each target platform (WPF for Windows, Cocoa for Mac, GTK for Linux). furthermore it easier to add advance/custom widget and hosted in XWT as it actually like hosted in native toolkit in each platform

Update:

About Winform is already answered, for XWT seem no designer yet, but for deploying, just creates projects XWT GUI (Shared all XWT GUI), XWT.WPF (XWT launcher for windows) and XWT.Cocoa (XWT MonoMac application for Mac). But the each launcher only can be compile in each platform

Anton Hasan
  • 551
  • 4
  • 14
  • all what you say is true, but you're not answering the question – knocte May 25 '13 at 08:03
  • XWT is awesome but the lack of multi-line text entry on GTK is a real show-stopper on Linux. As an old-time Mono guy, I find it crazy when Mono tech works better on OS X and Windows than it does on Linux. – Justin May 06 '14 at 15:29