English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Re: Glade support
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-05-18 (06:34)
From: Arturo Borquez <aborquez@a...>
Subject: [Caml-list] Re: Glade support
Hello Jacques,

  I've just downloaded the snapshot and I'll take a look. Some reflections
about the Glade stuff.

On Thu, 17 May 2001, Jacques Garrigue wrote:

> I think we enter here the main difference between using glade with C,
> and using glade with lablgtk. In C, you're not that much expected to
> understand the interface code. As long as you write the code for
> callbacks, this should produce a proper GUI. This is because the
> interface code is lengthy, and you don't want to write it by hand.
> In lablgtk, the interface code is very compact: all the layout only
> requires a function call by widget. You want generated code to be as
> natural as possible, so that you can use it as example to write by
> hand.  And signal binding does not require explicitly defining a
> function: passing it as a closure is often more natural.
> So I would suggest that you do not include any signal stuff inside
> glade_interface.ml, or only for predefined handlers. This would avoid
> a spurious backward dependency between glade_interface.ml and
> glade_signals.ml (which can be avoided by functors or classes, but
> still not very natural).

Yes!!! this is so true. The _main_ difference coding in LablGtk is that you
does not depend on the callbacks structure proposed by Glade (or callbacks in Glade are top functions and the event-driven nature cannot be abstracted) so you
has the choice to design the functional layout of your app. This not only is 
'more natural' style to Caml, but it adds a lot of extra power when dynamic
widget layout is needed and intra-function context callbacks tailoring. I agree Benjamin that Glade is a usefull tool for learning GTK to novices, but for a
skilled programmer 'Glade scheme' imposes programming style restrictions that doesn't pay the rapid visual widget placement. In my personal taste I prefer a
little pain packing the widgets by hand (1 or 2 lines per widget) and then
expand all the power of functional style in favour of expresiveness and elegant
app code, abstracted from the 'visual nature' of the interface.

Best regards

Find the best deals on the web at AltaVista Shopping!
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr