| gtk-0.11.0: Binding to the Gtk+ graphical user interface library. | Contents | Index |
|
Graphics.UI.Gtk.Builder | Portability | portable (depends on GHC) | Stability | provisional | Maintainer | gtk2hs-users@lists.sourceforge.net |
|
|
|
|
|
Description |
Build an interface from an XML UI definition
All functions in this module are only available in Gtk 2.12 or higher.
|
|
Synopsis |
|
|
|
|
Detail
|
|
Class Hierarchy
|
|
| GObject
| +----GtkBuilder
|
|
Types
|
|
data Builder |
Instances | |
|
|
class ObjectClass o => BuilderClass o |
| Instances | |
|
|
castToBuilder :: GObjectClass obj => obj -> Builder |
|
gTypeBuilder :: GType |
|
toBuilder :: BuilderClass o => o -> Builder |
|
data BuilderError |
Constructors | BuilderErrorInvalidTypeFunction | | BuilderErrorUnhandledTag | | BuilderErrorMissingAttribute | | BuilderErrorInvalidAttribute | | BuilderErrorInvalidTag | | BuilderErrorMissingPropertyValue | | BuilderErrorInvalidValue | | BuilderErrorVersionMismatch | | BuilderErrorDuplicateId | |
| Instances | |
|
|
Constructing and adding objects
|
|
builderNew :: IO Builder |
Creates a new Builder object.
|
|
builderAddFromFile :: Builder -> FilePath -> IO () |
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 () |
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.
|
|
builderAddObjectsFromFile |
:: 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.
|
|
|
builderAddObjectsFromString |
:: 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
|
|
builderGetObject |
:: GObjectClass cls | | => Builder | | -> GObject -> cls | A 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] |
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) |
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 () |
Sets the translation domain of the Builder.
|
|
builderGetTranslationDomain :: Builder -> IO (Maybe String) |
Gets the translation domain of the Builder.
|
|
Produced by Haddock version 2.4.2 |