Glade support

Benjamin Monate Benjamin.Monate at
Tue May 15 12:46:17 CEST 2001

On Tue, 15 May 2001 18:47:10 +0900
Jacques Garrigue <garrigue at> wrote:

> This approach works also, but has a big drawback: you cannot edit your
> files afterwards. So this is nice to start an application, but after
> that you have to code by hand.

This is not completly true.
In fact only the file that contains the interface is fully autogenerated.
A separate file contains the callbacks' bodies and this file is only
partly generated.
In particular, one handler looks like that in the code :

let on_liste_des_messages_selection_changed selection text1  () =
let selection = selection () in
(* BEGIN on_liste_des_messages_selection_changed *)
prerr_endline "Event selection_changed";()
(* END on_liste_des_messages_selection_changed *)

and only the parts between BEGIN and END comments should be edited. Each
time you change your interface, 
what you wrote between these comments is automatically reinserted is the
new code as body for the same handler.
Everything outside these comments is automatically generated.
This is pretty like what is done in C by glade.

If you want I can send you a complete example.

> My idea was to both interface to libglade, and generate wrappers to
> access the widgets build by libglade. To make it even more modular,
> these wrappers could eventually be compiled indepently, and modified
> by inheritance.
> This way you can modify easily details of the layout of your
> application, without having to change the ML code.

This is right but involves a lot of work to write the wrappers' generator.

> By the way, if you have a parser for glade description files, I'm
> interested. In fact, this is almost the only item I need to complete
> my scheme.

My parser is based on the tony XML parser and not complete as I add widget
properties by need.
But if you already have some kind of complete abstract syntax for glade
I can write the parser for you.

| Benjamin Monate         | mailto:Benjamin.Monate at |
| LRI - Bât. 490          |    |
| Université de Paris-Sud | phoneto: +33 1 69 15 42 32    |
| F-91405 ORSAY Cedex     | faxto: +33 1 69 15 65 86      |

More information about the Lablgtk-list mailing list