Allows dynamic loading of user interfaces from XML descriptions.
This object represents an `instantiation' of an XML interface description. When one of these objects is created, the XML file is read, and the interface is created. The GladeXML object then provides an interface for accessing the widgets in the interface by the names assigned to them inside the XML description.
The GladeXML object can also be used to connect handlers to the named signals in the description. Libglade also provides an interface by which it can look up the signal handler names in the program's symbol table and automatically connect as many handlers up as it can that way.
mchars
) (root mchars
) (domain mchars
) ⇒ (ret <glade-xml>
)Creates a new GladeXML object (and the corresponding widgets) from the XML file fname. Optionally it will only build the interface from the widget node root (if it is not ‘
#f
’). This feature is useful if you only want to build say a toolbar or menu from the XML file, but not the window it is embedded in. Note also that the XML parse tree is cached to speed up creating another GladeXML object for the same file
- fname
- the XML file name.
- root
- the widget node in fname to start building from (or ‘
#f
’)- domain
- the translation domain for the XML file (or ‘
#f
’ for default)- ret
- the newly created GladeXML object, or NULL on failure.
mchars
) (root mchars
) (domain mchars
) ⇒ (ret <glade-xml>
)Creates a new GladeXML object (and the corresponding widgets) from the buffer buffer. Optionally it will only build the interface from the widget node root (if it is not ‘
#f
’). This feature is useful if you only want to build say a toolbar or menu from the XML document, but not the window it is embedded in.
- buffer
- the memory buffer containing the XML document.
- size
- the size of the buffer.
- root
- the widget node in buffer to start building from (or ‘
#f
’)- domain
- the translation domain to use for this interface (or ‘
#f
’)- ret
- the newly created GladeXML object, or NULL on failure.
<glade-xml>
) (handlername mchars
) (proc scm
)In the glade interface descriptions, signal handlers are specified for widgets by name. This function allows you to connect a Scheme function to all signals in the GladeXML file with the given signal handler name.
- self
- the GladeXML object
- handlername
- the signal handler name
- func
- the signal handler function
<glade-xml>
) (module scm
)This function is a variation of
glade-xml-signal-autoconnect
. It will bind signal handers to the result of evaluating each signal handler name within module. So for example, if you have ten widgets defining a handler as the string"on-clicked"
, you might do this:(define (on-clicked . args) (display "Doing me thing...\n")) (signal-autoconnect glade-xml (current-module)) ;; now the on-clicked handlers are connected
- self
- the GladeXML object.
- module
- A scheme module in which to evaluate the signal handlers definitions.
<glade-xml>
) (name mchars
) ⇒ (ret <gtk-widget>
)This function is used to get a pointer to the GtkWidget corresponding to name in the interface description. You would use this if you have to do anything to the widget after loading.
- self
- the GladeXML object.
- name
- the name of the widget.
- ret
- the widget matching name, or ‘
#f
’ if none exists.
<glade-xml>
) (name mchars
) ⇒ (ret glist-of
)This function is used to get a list of pointers to the GtkWidget(s) with names that start with the string name in the interface description. You would use this if you have to do something to all of these widgets after loading.
- self
- the GladeXML object.
- name
- the name of the widget.
- ret
- A list of the widget that match name as the start of their name, or ‘
#f
’ if none exists.