gtk-0.11.2: Binding to the Gtk+ graphical user interface library.Source codeContentsIndex
Graphics.UI.Gtk.Builder
Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
Contents
Detail
Class Hierarchy
Types
Constructing and adding objects
Retrieving objects
Description

Build an interface from an XML UI definition

All functions in this module are only available in Gtk 2.12 or higher.

Synopsis
data Builder
class ObjectClass o => BuilderClass o
castToBuilder :: GObjectClass obj => obj -> Builder
gTypeBuilder :: GType
toBuilder :: BuilderClass o => o -> Builder
data BuilderError
= BuilderErrorInvalidTypeFunction
| BuilderErrorUnhandledTag
| BuilderErrorMissingAttribute
| BuilderErrorInvalidAttribute
| BuilderErrorInvalidTag
| BuilderErrorMissingPropertyValue
| BuilderErrorInvalidValue
| BuilderErrorVersionMismatch
| BuilderErrorDuplicateId
builderNew :: IO Builder
builderAddFromFile :: Builder -> FilePath -> IO ()
builderAddFromString :: Builder -> String -> IO ()
builderAddObjectsFromFile :: Builder -> FilePath -> [String] -> IO ()
builderAddObjectsFromString :: Builder -> String -> [String] -> IO ()
builderGetObject :: GObjectClass cls => Builder -> (GObject -> cls) -> String -> IO cls
builderGetObjects :: Builder -> IO [GObject]
builderGetObjectRaw :: Builder -> String -> IO (Maybe GObject)
builderSetTranslationDomain :: Builder -> Maybe String -> IO ()
builderGetTranslationDomain :: Builder -> IO (Maybe String)
Detail
Class Hierarchy
 | GObject
 | +----GtkBuilder
Types
data Builder Source
show/hide Instances
class ObjectClass o => BuilderClass o Source
show/hide Instances
castToBuilder :: GObjectClass obj => obj -> BuilderSource
gTypeBuilder :: GTypeSource
toBuilder :: BuilderClass o => o -> BuilderSource
data BuilderError Source
Constructors
BuilderErrorInvalidTypeFunction
BuilderErrorUnhandledTag
BuilderErrorMissingAttribute
BuilderErrorInvalidAttribute
BuilderErrorInvalidTag
BuilderErrorMissingPropertyValue
BuilderErrorInvalidValue
BuilderErrorVersionMismatch
BuilderErrorDuplicateId
show/hide Instances
Constructing and adding objects
builderNew :: IO BuilderSource
Creates a new Builder object.
builderAddFromFile :: Builder -> FilePath -> IO ()Source

Parses a file containing a GtkBuilder UI definition and merges it with the current contents of the Builder.

  • If an error occurs, the computation will throw an exception that can be caught using e.g. catchGErrorJust and one of the error codes in BuilderError.
builderAddFromString :: Builder -> String -> IO ()Source

Parses a string containing a GtkBuilder UI definition and merges it with the current contents of the Builder.

  • If an error occurs, the computation will throw an exception that can be caught using e.g. catchGErrorJust and one of the error codes in BuilderError.
builderAddObjectsFromFileSource
:: Builder
-> FilePath
-> [String]Object IDs
-> IO ()

Parses a file containing a GtkBuilder UI definition building only the requested objects and merges them with the current contents of the Builder.

  • If an error occurs, the computation will throw an exception that can be caught using e.g. catchGErrorJust and one of the error codes in BuilderError.
builderAddObjectsFromStringSource
:: Builder
-> String
-> [String]Object IDs
-> IO ()

Parses a string containing a GtkBuilder UI definition building only the requested objects and merges them with the current contents of the Builder.

  • If an error occurs, the computation will throw an exception that can be caught using e.g. catchGErrorJust and one of the error codes in BuilderError.
Retrieving objects
builderGetObjectSource
:: GObjectClass cls
=> Builder
-> GObject -> clsA dynamic cast function which returns an object of the expected type, eg castToButton
-> String
-> IO cls

Gets the object with the given name, with a conversion function. Note that this computation does not increment the reference count of the returned object.

If the object with the given ID is not of the requested type, an exception will be thrown.

builderGetObjects :: Builder -> IO [GObject]Source
Gets all objects that have been constructed by builder. Note that this computation does not increment the reference counts of the returned objects.
builderGetObjectRaw :: Builder -> String -> IO (Maybe GObject)Source
Gets the object with the given name. Note that this computation does not increment the reference count of the returned object.
builderSetTranslationDomain :: Builder -> Maybe String -> IO ()Source
Sets the translation domain of the Builder.
builderGetTranslationDomain :: Builder -> IO (Maybe String)Source
Gets the translation domain of the Builder.
Produced by Haddock version 2.6.1