Gtk2HsContentsIndex
Graphics.UI.Gtk.Glade
Contents
Data types
Creation operations
Obtaining widget handles
Description

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 GladeXML objects.

glade_xml_signal_autoconnect() is not supported. The C variant is not suitable for Haskell as -rdynamic leads to huge executable and we usually don't want to connect staticly named functions, but closures.

  • glade_xml_construct() is not bound, as it doesn't seem to be useful in Haskell. As usual, the signal_connect_data variant for registering signal handlers isn't bound either. Moreover, the connect_full functions are not bound.
  • 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.
Synopsis
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)
Data types
class GObjectClass o => GladeXMLClass o
show/hide Instances
data GladeXML
show/hide Instances
Creation operations
xmlNew :: FilePath -> IO (Maybe GladeXML)
Create a new XML object (and the corresponding widgets) from the given XML file; corresponds to xmlNewWithRootAndDomain, but without the ability to specify a root widget or translation domain.
xmlNewWithRootAndDomain :: FilePath -> Maybe String -> Maybe String -> IO (Maybe GladeXML)

Create a new GladeXML object (and the corresponding widgets) from the given XML file with an optional root widget and translation domain.

  • If the second argument is not Nothing, the interface will only be built from the widget whose name is given. 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 'XML' object for the same file.
Obtaining widget handles
xmlGetWidget :: WidgetClass widget => GladeXML -> (GObject -> widget) -> String -> 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.

  • the second parameter is the ID of the widget in the glade xml file, eg "button1".
  • the third parameter should be a dynamic cast function that returns the type of object that you expect, eg castToButton
xmlGetWidgetRaw :: GladeXML -> String -> IO (Maybe Widget)
Produced by Haddock version 0.7