

Cross Platform Development with Mono - stevehaunts
http://stephenhaunts.com/2014/04/28/cross-platform-development-with-mono/

======
mwcampbell
I must strongly recommend against using Gtk+ as a GUI toolkit for any serious
application except on GNU/Linux. The biggest reason for me is that Gtk+ has
zero accessibility support on Windows or Mac. That is, it doesn't work with
assistive technologies which people with some disabilities need, such as
screen readers for blind people. If you develop an application using an
inaccessible toolkit, you're erecting a barrier for some people who might need
to use your app, particularly if it's going to be used in an educational or
business setting.

So, what should you use instead? Qt is better, but not great. It's still bad
enough that TeamTalk, a voice chat app that's popular among blind people, has
a cross-platform Qt app but also a "classic" MFC app for Windows. The latter
used to be the official Windows client, but is now maintained just for blind
users.

wxWidgets is better in some ways, because it uses native controls on each
platform. Except where it doesn't; for example, the data view control is non-
native on Windows, whereas the list view control is non-native in the Mac and
GTK ports. and wxHTML is non-native across the board. Still, with some pain,
wxWidgets can be made to work for cross-platform accessible apps.

SWT might be a good choice, if you can make it work for .NET/Mono using
IKVM.NET. SWT is better than wx in that where it has to use non-native
controls, it implements the platform accessibility APIs; it helps that SWT is
backed by IBM, which has the resources to put into this kind of thing, and the
incentive to do so in the form of sales to government agencies and the like.

~~~
blub
I'd be interested to know what kind of problems Qt has with accessibility, I
have personally not used the QAccessible* classes yet and would appreciate any
tips from the field.

Some potentially interesting blog posts:
[http://blog.qt.digia.com/blog/category/accessibility/](http://blog.qt.digia.com/blog/category/accessibility/)
I wonder what came out of the major upgrade in Qt 5, from looking around the
web it seems to support MSAA fully and also I2A in some form.

~~~
mwcampbell
I haven't looked at the state of accessibility in Qt 5. I'll have to check
that out.

------
gum_ina_package
Interesting to see all the recent activity on HN about cross platform
development. Seems like, as far as native code solutions go, C#/.NET is our
best bet. As a C# junkie I'm excited about this, but also kinda sad that HTML5
cross platform development never really took off.

Edit: When I said "native code", I meant that Mono allows you to wrap native
libraries with greater ease than anything else I've ever encountered.

~~~
Touche
.NET isn't native code.

~~~
cwyers
There are multiple native compilers for .NET. Xamarin uses one for iOS and
Android apps (well, in the case of Android, you're compiling to Dalvik
bytecode, but it's just as native as any other Android app).

~~~
sochinochi
Xamarin.Android apps do not compile to Dalvik bytecode. Every app ships with
MonoVM which runs side-by-side with Dalvik.

~~~
cwyers
Thank you for the correction; I seem to have had Xamarin on Android confused
with Xamarin on iOS, which does compile to native code.[1]

1)
[http://docs.xamarin.com/guides/ios/advanced_topics/limitatio...](http://docs.xamarin.com/guides/ios/advanced_topics/limitations/)

------
billyhoffman
Have they fixed the bug where you can't copy/paste between mono apps and
native OS X apps yet?

[https://bugzilla.xamarin.com/show_bug.cgi?id=3106](https://bugzilla.xamarin.com/show_bug.cgi?id=3106)

\--

Steps to reproduce the problem:

1\. Copy some text in any non-mono application

2\. Paste it to mono application.

Actual Results:

Copy&Paste doesn't work.

Expected Results:

Working clipboard.

How often does this happen?

Always.

\--

Wow. So by cross platform they mean "unusable GUI apps on Macs"

~~~
visualR
If you were going to develop a mono app on osx you'd be better off using
monomac than gtk#. Mono develop is written in gtk# and cut and paste works
just fine on osx.

~~~
billyhoffman
My use case is the most basic one possible:

-Build a GUI app in C# -Run in on both my Windows dev machine (Windows 7), and my main desktop (OS X)

That's it. I don't care even what I have to use to build the app (Windows
Forms, Stetic, etc).

Any advice?

~~~
jonpaul
Have you considered using node-webkit, AngularJs, and Bootstrap for your cross
platform GUI needs?

~~~
visualR
The problem with this is you only get 1 thread for the UI and other stuff to
run on.

------
francisl
"I still really like the .NET environment and C# language, ... "

This is not my case, but I really do find value in learning a technology that
helps you build cross-platform solution. I seriously considered using it.

"Thankfully, there is the Mono .NET implementation that I can use and it is
really well supported."

But it's kind of unsupported and most of the time it lags behind. Currently on
my brand new ubuntu system, it's version 3.2, on my "stable" ubuntu its 2.10.
The current version is 3.4.

" As well as being open source, Mono also has a company, Xamarin, sponsoring
its development as they use the mono system for their IOS and Android ..."

You cannot develop iOS nor Android application on Linux with Xamarin, You need
Windows or OS X.

This is old bug still accurate.
[https://bugzilla.xamarin.com/show_bug.cgi?id=142](https://bugzilla.xamarin.com/show_bug.cgi?id=142)

This is an actual deal breaker for us. Haft of the team is using OS X and the
other haft Ubuntu.

~~~
cwyers
"But it's kind of unsupported and most of the time it lags behind. Currently
on my brand new ubuntu system, it's version 3.2, on my "stable" ubuntu its
2.10. The current version is 3.4."

Isn't that more of a problem with Debian/Ubuntu than it is Mono? You're not
comparing what Mono's released to Microsoft's .NET runtime, you're comparing
what Ubuntu ships to what Mono themselves have released.

~~~
francisl
I understand that is not the actual status and capabilities of mono. But if
you want to ship your app and use the latest feature, this is a problem.

If it's a couch-developed app for your own use, this is not an issue.

~~~
cwyers
Sure, but that's an issue in packaging software for Linux that goes far beyond
Mono/Xamarin. Any software you develop for Linux that has external
dependencies is dependent upon the decisions of at least a dozen major
distributions on what to support, package and ship. Solving that problem is
way behond the scope of the Mono runtime.

------
adamors
Do these people actually use Monodevelop daily? Because my and a lot of other
people's experience beyond a Hello World program is dismal.

And until you actually have cross platform development _tools_ that don't
suck, .NET is not a viable option.

~~~
CmonDev
The authoring platform doesn't matter as long as the product is cross-
platform. Just use Windows to get the best development experience. I mean
people use Sublime which is like a notepad on steroids and don't complain.

~~~
adamors
> The authoring platform doesn't matter as long as the product is cross-
> platform.

I think it matters a lot. That's why a lot of people don't care about .NET/C#
actually, because they can't stand Windows.

------
leafartist
This post inspired me to fire up my Linux mint virtual box and test mono. I'm
every impressed by its potential. It does lack some awesome c# features like
async/await. I've been using Xamarin for a while now and love it. My only fear
for mono on Linux is the lack of XAML like interface equivalent. I dislike
GTK. I'm keeping my fingers crossed :)

~~~
theflagbug
I'm pretty sure async/await is supported

Source: I'm using async/await in Xamarin.Android

Maybe it's because Linux Mint doesn't have the latest version of Mono in the
package repository?

------
c0deporn
Nice, I just gave a talk on Xamarin and building cross-platform native apps at
a mobile workshop this weekend.

------
herokusaki
I haven't used it in a while but Tcl/Tk with Tile (now known as ttk) used to
be a decent solution for cross-platform GUIs with native-looking widgets.
Among other things it had top-tier Unicode support and a declarative layout
system (compare: QML). Is it still viable?

------
bigdubs
I love Mono Develop / Xamarin studio, but it needs split panes desperately.

------
tempodox
Mono is not “cross” platform. It infects your environment with .NET which is
very much a platform.

~~~
untog
It is an environment that allows your code to run on multiple platforms. It is
cross platform.

