caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: frouaix@liquidmarket.com
Cc: caml-list@inria.fr
Subject: Re: OCaml's long range graphical direction?
Date: Fri, 09 Feb 2001 18:49:01 +0900	[thread overview]
Message-ID: <20010209184901V.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <200102082001.f18K1VH08374@nez-perce.inria.fr>

Salut Francois,

> I actually think that none of CamlTk/LablTK/LabelGTK fit the most
> common need in GUI development. In many cases, it still strikes me
> as utterly boring and time consuming to write *code* to put up
> menus, buttons, dialogs and such. Of course, from time to time, when
> you need some form of widget that is a bit original, programming
> will be useful. But that doesn't happen a lot, unless you write
> something that needs complex rendering or interaction.  Back in
> 1985, Apple started using resources to define interfaces. More
> recently, Palm used resources again to define interfaces. More
> recently, Mozilla folks used XML based representation (XUL) to
> define interfaces, with a GUI level scripting language
> (JavaScript/ECMAScript).
> This type of approach has, in theory, lots of advantages
>   - forces separation GUI from logic in the code
>   - allows non-programmers to do the GUI design/layout (maybe using 
> interactive tools in the process).
>   - themes easily abstracted
>   - language independence, extensibility, device independence

In fact, the gnome project has a GUI builder called glade, which
allows one to produce either C code or an XML representation of the
interface. There is even a library libglade which allows one to
dynamically load such an XML representation and use it in a program.

It would be pretty easy to either interface to this library, or, more
interestingly, build a parser and interpreter for it, so as to be able
to use glade's output in lablgtk or mlgtk programs.
We had more grandiose projects with lablgtk, including creating a real
GUI builder, allowing to input directly Caml code in the interface
design, but this is lots of work for a volunteer effort, so the glade
approach could be a good future direction.

Still, I'm not sure I would use it personally. Basically, when I write
a lablgtk application, the code is not in the GUI layout: this is just
one line per widget. It is in all the callbacks and dynamic
processing.  I'm not so sure a GUI builder will help you a lot with
that, because it can also get in your way.

Another aspect is that separating GUI from logic is sometimes going
against modularity. The object-oriented widget approach takes the
widget as a unit for both GUI and logic, which helps in building
programs from parts.  Gtk also handles themes at the widget level.

The last problem is how to stay type safe when you load a text file.
Basically this means that you will be more verbose, and that will
compare badly with guile-gtk or python-gtk based applications.

So, there might be something to do, but I'm not so much convinced it
will help with a language like ocaml.

Amicalement,

Jacques



  parent reply	other threads:[~2001-02-09  9:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-05 17:48 Daniel Ortmann
2001-02-06  9:28 ` Xavier Leroy
2001-02-06 18:19   ` Sven LUTHER
2001-02-07 21:30     ` Pierre Weis
2001-02-08  7:32       ` Sven
2001-02-08  1:59     ` Jacques Garrigue
2001-02-08  7:55       ` Sven
2001-02-09  8:47         ` Claudio Sacerdoti Coen
2001-02-09 10:00           ` Sven LUTHER
2001-02-08 20:35       ` Brian Rogoff
2001-02-09  1:28         ` Jacques Garrigue
2001-02-09 18:11           ` Brian Rogoff
2001-02-10 13:01             ` Jacques Garrigue
2001-02-09 20:01           ` Marcin 'Qrczak' Kowalczyk
2001-02-12 14:52             ` Nicolas barnier
2001-02-12 23:47               ` Jacques Garrigue
2001-02-15 12:21                 ` [Caml-list] " Sven LUTHER
2001-02-08 10:28     ` Alan Schmitt
2001-02-09  1:24       ` bcpierce
2001-02-06 20:30   ` Dale Arntson
2001-02-07  0:39   ` John Max Skaller
2001-02-08 20:01   ` Francois Rouaix
2001-02-09  9:41     ` Sven LUTHER
2001-02-09  9:49     ` Jacques Garrigue [this message]
2001-02-09 19:58       ` Jerome Vouillon
2001-02-10 12:36         ` Jacques Garrigue
2001-02-10 21:25         ` Pierre Weis
2001-02-09 17:50     ` John Max Skaller
2001-02-06 19:33 Maxence
2001-02-09 23:31 Arturo Borquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010209184901V.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=frouaix@liquidmarket.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).