In my last instalment of my Mac Diaries I described my first
experiences with developing cross platform between the Apple Mac and the PC,
and in ending I mentioned the CocoaSharp, the Mono initiative which promises to
make many of the nice native Mac OS X widgets accessible to .NET developers. I said I would consider implementing a
dedicated Mac GUI with this platform if I can't achieve a satisfactory user
experience through standard Windows Forms on Mono.
I have spent two days trying to find out a bit more about
CocoaSharp, and have decided that it is definitely not a library I will be
using in a production project anytime soon.
Despite encountering several mentions of the Mono team adopting it in
preference to Gtk# for the Mac side of things, this project is not receiving
yet enough attention to be credible. I also
looked at MonoDevelop during this time, but to say that the build and install
process on the Mac is not for the feint hearted is a gross understatement!
What I gathered to be the official web site is empty, except
for a very short project description, and two links. One of the links refers back to the main Mono
site and offers some relief to those unfortunate enough to first follow the
other link to the CocoaSharp Wiki. This
wiki is atrocious, and not just for lack of content. It is badly organised, offers confusing and
duplicated topical links, and has several broken links. Although the team appeals for contributions
in the home paragraph, I don't think enough people even are aware of the
project, never mind willing to volunteer for documentation contributions.
The only real contribution I can see on the wiki is that of
Tim Davis, who offered a few meaningful tutorials and examples. This man was kind enough to leave a contact
email address, and respond to my queries about anomalous differences between my
current installation of CocoaSharp and the content on the wiki. He has also been kind enough to mail me more
current example projects that no longer exhibit these anomalies. I will be posting his updated examples here
soon, but if anyone would like I could mail them to you.
During a long Google session I discovered the world of
wxWidgets though its .NET port, wx.NET. The
wxWidgets library is a popular cross platform GUI toolkit that can be used on
most operating systems, in C++, Python, Perl, or C#. One of the differences between this and other
cross-platform toolkits is that at the implementation level, it uses the native
controls of each specific platform to achieve a look and feel familiar to
users.
wx.NET is a C# wrapper for the main wxWidgets library, and
although active development on this project has ceased, the last version
includes a Perl script to generate C# wrappers by parsing the wxWidgets C++
header files. It also includes the TowxNET
tool, for converting wxGlade or XRC files to C# or even VB.NET. Very
good UI designer support for the toolkit is available through the wxDevC++ IDE,
which although requiring some C++ coding from people like me who aren't very
used to it, provides a solid design and coding experience.
However, I still have one major challenge to continuing this
port, and that is to include a fancy WYSIWYG HTML editor on several forms. Every HTML editor I have found for MS Windows
Forms uses some aspect of the Internet Explorer COM component, and I simply haven't
found any such editors for wxWidgets or Mono Windows Forms. Although Mono has a WebBrowser project, which
attempts to mimic the Windows version by using the Mozilla browser component,
it looks stalled due to technical difficulties or lack of interest and no
response is forthcoming from the project owner.