Version 1 of Loading Glade UI Confgiuration Files into Tcl/Gnocl Applications

Updated 2009-03-26 15:29:59 by tb

WJG (26-Mar-09) One of the features added into Gnocl 0.9.94 is the import of Glade files and there are some expiremental scripts in the present release to illustrate the power of using Glade files.

Glade is a Gnome developer application which allows for the visual creation of detailed UIs drawing upon the wide range of Gtk/Gnome widgets. The latest release of Glade [L1 ] may even have support for other popular third party widgets. The resulting layout is saved as an XML file and be easily loaded into a tcl script using the gnocl::gladeXML command. At the moment this feature is still under development and much work needs to be done on settling upon a strategy on how to bind the UI signal callbacks to scripts on the Tcl side of the interpreter.

Whilst I personally have steered away from using visual UI builders and prefer the direct approach of scripting, fot the vast majority of Gtk developers Glade is a 'wonder-tool'. Incorporating full support for both Glade and GtkBuilder would place Tcl in a good position in the Gtk bindings stakes as Gnocl would really come into its own, not merely as a UI builder, but enabling the runtime reconfiguration of widget which is complex using C.


tb 2009-03-26 - Me Too! I was thinking about just traversing the glade file using tdom and then returning some code, containing a window creation procedure and some callback handler stubs.

Package example:

 namespace eval ::sysdlg::file {
   eval [::gnocl::tclFromGlade "filedlg.glade"]
 }
 package provide filedialog 0.1

Now, one could load the package, lookup the callback handlers like...

  info proc ::sysdlg::file::handle*

...and start overwriting the stubs. Ready!


enter categories here