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
Does LablTk have a future?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-08-30 (16:25)
From: Chris Campbell <cyberdanx@g...>
Subject: Re: GUI for OCaml (was: Re: [Caml-list] Does LablTk have a future?)
First, I hate AJAX.  Breaks the back button! :(  Yes, this is the
second time I've written this email.

On 30/08/05, Jon Harrop <> wrote:
> On Tuesday 30 August 2005 15:14, Richard Jones wrote:
> > Lablgtk2 is a pain, but I think the pain comes from Gtk itself, not
> > any shortcomings in lablgtk2 or ocaml.
> Yes. My understanding is that lablgtk does a lot to hide the hideousness
> beneath.
> > > However this is a huge task. [...]
> >
> > It is a huge task.
> Depending on what exactly we're talking about, I think it is entirely
> tractable for one person, let alone a team.
> > I'm not even sure what a "functional" API for a
> > GUI toolkit would look like.  Ideas?  Example code snippets?
> I think the GUI code should be split into definition (i.e. how the widgets are
> laid out) and execution (i.e. what functions are called for GUI events). The
> former should be functional in style because it is easier to write and more
> succinct and the latter should be imperative in style because it is
> essentially poking a state machine about.
This sounds like QTk.  It is a wrapper to Tk that uses records (tuples
and atoms are records in Oz) and call backs to implement the gui. 
It's quite effective.  In Oz, your example would look something like
this... (warning, last Oz use was a while ago) td(lr(label:"Search" text(handle: H))
                 (lr(button(text:"Add" action:P)

Where P and H are call back procedures.

> Perhaps we should start by writing such a wrapper that can target either
> labltk or lablgtk?

Make it independant to a degree.  Most GUIs offer the same functionality anyway.