Date: 17 May 2001 23:34:50 -0700 Message-ID: <20010518063450.19138.cpmta at c012.sfo.cp.net> Content-Type: text/plain Content-Disposition: inline Mime-Version: 1.0 To: garrigue at kurims.kyoto-u.ac.jp From: Arturo Borquez Cc: caml-list at inria.fr Subject: 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 Arturo Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com