Re: [Java-gnome-developer] LibGladeStubs usage
Brought to you by:
afcowie
From: Nicola L. <nic...@gm...> - 2005-01-15 15:25:10
|
Hi. You didn't get me completely right. I know that generating code from glade files is deprecated (like the glade-2 c/python source generator), and one should use LibGlade that creates the windows reading the glade file at runtime. In this way you have to write a "LibGlade interfacing" class that looks like the one here: http://java-gnome.sourceforge.net/cgi-bin/bin/view/Main/GladeGUIS where you puts a method for each event handler in the glade file, like this: public void on_window1_delete_event(LifeCycleEvent s) Now, what i was searching for is not a code generator like the one above, but a program that generates "LibGlade interfacing" class. This becouse i find boring to copy all event handlers that are present in the glade file as methods on the class. You have to check the spelling etc, etc. Also, i don't know what kind of parameters this methods should have. This could be done with a program that takes the glade file and generates an Interface like this: package xxx; import xxx; interface Gladexxx { void on_window1_delete_event(LifeCycleEvent s); void on_open_activate(MenuItemEvent s); void on_button_click_event(???Event s); etc etc } So that, by implementing the interface, you know your class will capture all glade file events. Or, instead of an interface, it could generate an abstract class.. that's only to see what is more convenient. Once you change the glade file, you can regenerate the class without problems I like this kind of code generation. If you know Torque (http://db.apache.org/torque/) or XMLC (http://xmlc.enhydra.org) you know what i mean :P Greetings. On Sat, 15 Jan 2005 13:31:37 +0000, Mark Howard <mh...@ti...> wrote: > Jeff already replied on irc, but for the benefit of anyone else reading this: > libGladeStubs is old code and was never really implemented fully. There isn't > any need for it, since libglade does a far better job (similarly, other > languages are all favouring libglade). > There's a possibility that something might change in 2.12 though. > > -- > .''`. Mark Howard > : :' : > `. `' http://www.tildemh.com > `- mh...@de... | mh...@ti... > |