garrigue at kurims.kyoto-u.ac.jp
Tue May 15 17:28:10 CEST 2001
After second thought, I think your approach can be very useful, and at
The first one is for beginners: this can help them write their first
programs, generating the difficult part of the code, before they
familiarize themselves with lablgtk.
This part becomes less interesting once you know more of lablgtk.
Also, lablgtk is very strong at callbacks, so that having the
callback stubs generated automatically is not a great boon.
The second one is complementary with the libglade based approach: once
you have fixed your layout, you can get rid of libglade by generating
I still think that libglade is better during development: you can
build a first GUI, build your program around it, and then refine the
layout _without recompiling the program_. This greatly improves design
speed: you switch between glade and program testing, without compiling
And generating stubs for libglade is very easy: you just need to
extract widget names and their classes from the glade description. See
how you can obtain window1 and text1 in glade_demo.ml. You don't even
need a full fledge parser for that.
So, in an ideal view, mlglade and libglade would be complementary:
you first generate libglade stubs, and build your program around them,
refining the program and the GUI. Once you're statisfied with the
result, you generate your final code with mlglade, and have a running
application, with no unnecessary dependencies.
For this to work, both libglade and mlglade stubs should be
compatible. A possible way to do that is making the basic interface a
simple class, where each method returns a widget in the
layout. Classes are better than modules at this, because they can be
Anyway, if you have code ready, I would happily give you a CVS access,
so that you can add it to the distribution.
More information about the Lablgtk-list