source: trunk/third/libglade/README @ 15324

Revision 15324, 2.6 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15323, which included commits to RCS files with non-trunk default branches.
RevLine 
[15323]1LIBGLADE
2========
3
4Author: James Henstridge <james@daa.com.au>
5
6This library allows you to load glade interface files in a program at runtime.
7It doesn't require GLADE to be used, but GLADE is by far the easiest way to
8create the interface files.
9
10For an idea of how to use the library, see test-libglade.c and
11glade/glade-xml.h.
12
13To compile, you will need the libxml package (aka the gnome-xml module in CVS)
14which can be found on the GNOME FTP site or its mirrors.  If you want GNOME
15support, you will also need the gnome-libs package installed.
16
17When I started developing this library, I was using a 486, and did not have
18any problems with the speed.  Since then, I have reduced its memory usage
19and increased its speed a bit, so you should not have problems with the
20library's speed :)
21
22I would like to thank Damon Chaplin for writing GLADE, which is one of the
23best user interface builders I have used.
24
25
26LIBGLADE INTERNALS
27==================
28
29If you are interested in how libglade works, here is a small description:
30
31When glade_xml_new is called, the XML file is loaded using libxml.
32Libglade uses the SAX interface because it is faster and allows me to
33store the data in a more compact representation.  The data in the XML
34file is cached, so that if you load the interface again, the file does
35not need to be reparsed.  If the file has changed though, it will be
36reparsed.
37
38The styles in the glade file are first passed to the GTK RC system, so
39they can be applied to the widgets when the interface is built.  Note
40that newer versions of GLADE have removed the widget style code.
41
42Now glade_xml_build_widget is called for all the toplevel widgets in
43the interface (or if the second argument to glade_xml_new was non
44NULL, the widget it refers to is treated as the toplevel).
45
46For each of these widgets, they are created by a function specific to
47the widget type, and then glade_xml_build_widget is called for each
48child widget, which is then packed into its parent.  This is done
49recursively, so the whole interface is constructed.
50
51New widget types are added to the widget class hash with the
52glade_register_widgets function.  For an example, see the end of glade-gtk.c.
53
54The automatic signal connection system uses the introspective capabilities of
55dynamic linking.  By openning a handle on NULL, we can get at all the global
56symbols (global functions, global variables) in the executable, and the
57libraries it is linked against.  This is used to find the address of a signal
58handler from its name, so that gtk_signal_connect can be called automatically
59for you.
60
61Of course, there are other ways of connecting the signals if your platform
62doesn't support this feature.
Note: See TracBrowser for help on using the repository browser.