Libglade facilitates loading of XML specifications of whole widget trees
that have been interactively designed with the GUI builder Glade. The
present module exports operations for manipulating
- This binding does not support Libglade functionality that is exclusively meant for extending Libglade with new widgets. Like new widgets, such functionality is currently expected to be implemented in C.
- class GObjectClass o => GladeXMLClass o
- data GladeXML
- xmlNew :: FilePath -> IO (Maybe GladeXML)
- xmlNewWithRootAndDomain :: FilePath -> Maybe String -> Maybe String -> IO (Maybe GladeXML)
- xmlGetWidget :: WidgetClass widget => GladeXML -> (GObject -> widget) -> String -> IO widget
- xmlGetWidgetRaw :: GladeXML -> String -> IO (Maybe Widget)
Create a new XML object (and the corresponding widgets) from the given XML file.
This corresponds to
xmlNewWithRootAndDomain, but without the ability
to specify a root widget or translation domain.
the XML file name.
|-> Maybe String|
|-> Maybe String|
|-> IO (Maybe GladeXML)|
Create a new GladeXML object (and the corresponding widgets) from the given XML file.
Optionally it will only build the interface from the widget
root (if it is not
Nothing). 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.
Obtaining widget handles
|:: WidgetClass widget|
|-> (GObject -> widget)|
a dynamic cast function that returns the type of object that you expect, eg castToButton
the second parameter is the ID of the widget in the glade xml file, eg "button1".
|-> IO widget|
Get the widget that has the given name in the interface description. If the named widget cannot be found or is of the wrong type the result is an error.