Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] WxWidgets?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-09-16 (21:29)
From: chris.danx <chris.danx@n...>
Subject: Re: [Caml-list] WxWidgets?
Richard Jones wrote:
> On Thu, Sep 16, 2004 at 09:08:48PM +0100, chris.danx wrote:
>>Has anyone made such a binding?  If not I was thinking about using swig 
>>and the wxpython interfaces as the starting point for a wxwidgets 
>>binding for ocaml.  Has anyone tried to do this in the past?  Any 
>>thoughts on the issue?
> I've looked into this in the past, but we ended up using Gtk +
> Gtk-Wimp on Windows, which worked quite well.

How was that?  Choosing WxWidgets instead of Gtk+ was an option I was 
evaluating (not keen on using gtk+ at all really, it's my least 
favourite gui toolkit).  I might stick with Gtk+ though!  It's not like 
it's a commercial application, it's just for fun and going with Gtk 
means it will actually be completed.

> Here are my observations on going the WxWindows route though:
> (1) WxWindows is pretty good.  (Ah, looking at their website, I see
> they've renamed it to WxWidgets!).  WxWIDGETS is pretty good.  It's a
> very complete way to develop cross-platform applications.  In
> particular, it has platform-specific file and print dialogs, which you
> won't get if you use Gtk.  In fact if you use Gtk you won't get print
> dialogs at all - I had to write my own print dialog for Windows which
> was no fun at all.

Thankfully it's a Tetris clone.  No dialogs required. :)

I plan to develop something more substantial in Ocaml, but for now I'm 
just playing with OpenGL and other things.

> (2) There seem to be three decent approaches to using WxWidgets under
> OCaml: Python, Perl or native.  Native is going to be the best, but is
> going to take a heck of a lot of effort.
> (3) Python or Perl: it's easiest just to use PyCaml or Perl4Caml to
> interface with the Wx* libraries under those languages.  I don't see
> why you'd want to go through SWIG for this.

I wasn't thinking of interfacing to perl or python.  Just using the 
wxWidgets swig interfaces used by wxPython as the start of a binding.  I 
was not sure what kind of effort would be involved in that but from a 
little experiment just now I realised how much effort it would be... 
huge.  The problem with this approach is that the python stuff has to be 
filtered down to a managable size which is likely to be more work than 
starting from scratch.

> (4) Native: definitely the best performance and the cleanest approach,
> however it's lots of work.  (Now of course if you wanted to *hire*
> Merjis to do the work, contact me off-list ... :-)

If I had the money maybe! :)

*checks last nights lottery ticket* ... two numbers and another number 
just one away for a tenner AGAIN! *sigh*


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: