[mercury-users] GUI Toolkits and Mercury

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Nov 23 01:14:29 AEDT 2005


On Tue, 22 Nov 2005, Jonathan Morgan wrote:

> What is the state of GUI toolkits under Mercury?  In the extras distribution
> there is an X binding (not really portable to Win32/Mac OS X),

It certainly works on Mac OS X, assuming you have X installed on your
machine.

> a binding to
> OpenGL and GLUT and a binding to Tcl/Tk.  This last one is probably the only
> widget-style set here that is cross-platform and commonly used.
>
> All these seem to be for C backends only.  What would be used for IL/Java?
> Would you use C#/Winforms or Java/Swing?

Most probably.

> Is there any kind of Mercury
> binding for these, or would you just use existing tools to generate pure
> Java/C# files calling Mercury functionality?
> Are there any plans to make a binding to a cross-platform toolkit apart from
> Tk (eg. wxWidgets, Gtk+)?  Are there plans to make native Mercury GUIs
> available for multiple platforms (eg. IL/Java/C)?
>
> My feeling is that mtk might be able to be ported to IL/Java with
> comparative ease, as it is almost entirely pure Mercury, and you would only
> need to bind mtcltk to a Tcl binding like tickle-sharp or Jacl.
>
> In terms of features, power, and native support for various platforms
> wxWidgets would probably be best for Win32 and Mac OS X, while Gtk+ would be
> best for X (wx binds to Gtk+, but I'm told that native Gtk applications
> generally look better).

We were considering a binding to wxWidgets.  Indeed we even offered it as an
honours project this year but there were no takers amongst the students.  As
you point out below, the major disadvantage of wxWidgets is the necessity of
writing Mercury-C-C++ "glue" code to join all the bits up.  In practice it
would probably be possible to extend the foreign language interface to
generate a lot of the glue code automatically so it wouldn't be that bad.

> Gtk and Tk are more lightweight than wx, though wx
> can support things like ODBC and networking.

I spent some time looking at Gtk a year or so ago, from memory it has a number
of features that make writing a Mercury binding for it quite awkward.

> wx would pay the price of a
> C++-to-C binding, and Tk that of a Tcl-to-C binding, whereas Gtk is C.  Gtk
> has strong bindings to IL and Java (Gtk# is a core mono project, and
> java-gnome is one of Gtk's more important bindings).  wx has a comparatively
> recent binding to Java (wxJava), and a more mature binding to .NET (wx.NET),
> which also provides SWIG generated wx-C bindings.
>

Cheers,
Julien.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list