## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Builder

- Goto spec source

# Description

    package Gtk.Builder is

Gtk.Builder - Build an interface from an XML UI definition as produced by the Glade-3 GUI builder.

Note that GtkAda provides a higher-level API for using the GUI builder, in Gtkada.Builder.

A Gtk_Builder is an auxiliary object that reads textual descriptions of a user interface and instantiates the described objects. To pass a description to a Gtk_Builder, call Add_From_File or Add_From_String.

These subprograms can be called multiple times; the builder merges the content of all descriptions.

A Gtk_Builder holds a reference to all objects that it has constructed and drops these references when it is finalized. This finalization can cause the destruction of non-widget objects or widgets which are not contained in a toplevel window. For toplevel windows constructed by a builder, it is the responsibility of the user to call Gtk.Widget.Destroy to get rid of them and all the widgets they contain.

The subprograms Get_Object and Get_Widget can be used to access the widgets in the interface by the names assigned to them inside the UI description.

Toplevel windows returned by this subprogram will stay around until the user explicitly destroys them with Gtk.Widget.Destroy.

Other widgets will either be part of a larger hierarchy constructed by the builder (in which case you should not have to worry about their lifecycle), or without a parent, in which case they have to be added to some container to make use of them. Non-widget objects need to be reffed with Glib.Object.Ref to keep them beyond the lifespan of the builder.

The subprogram Connect_Signals_Full can be used to connect handlers to the named signals in the description.

Binding from C File version 2.16.6

# Classes

### Gtk_Builder_Record

- Goto declaration in source
- Goto full declaration in source

    type Gtk_Builder_Record is new Glib.Object.GObject_Record with private;

#### Ancestors:

Glib.Object.GObject_Record

#### Immediate Children:

Gtkada.Builder.Gtkada_Builder_Record

#### Primitive operations:

Add_From_File

- To API doc
- To spec

Add_From_String

- To API doc
- To spec

Connect_Signals_Full

- To API doc
- To spec

Get_Object

- To API doc
- To spec

Get_Widget

- To API doc
- To spec

Glib.Object.Deallocate

- To API doc
- To spec

(Inherited)
Glib.Object.Get_Type

- To API doc
- To spec

(Inherited)
Glib.Object.Notify

- To API doc
- To spec

(Inherited)
Glib.Object.Ref

- To API doc
- To spec

(Inherited)
Glib.Object.Ref_Sink

- To API doc
- To spec

(Inherited)
Glib.Object.Unref

- To API doc
- To spec

(Inherited)

# Types

### Gtk_Builder

- Goto declaration in source

    type Gtk_Builder is access all Gtk_Builder_Record'Class;

### Gtk_Builder_Connect_Func

- Goto declaration in source

    type Gtk_Builder_Connect_Func is access procedure
         (Builder        : System.Address;
          Object         : System.Address;
          Signal_Name    : Interfaces.C.Strings.chars_ptr;
          Handler_Name   : Interfaces.C.Strings.chars_ptr;
          Connect_Object : System.Address;
          Flags          : Glib.G_Connect_Flags;
          User_Data      : System.Address);

# Constants & Global variables

### Translation_Domain_Property

- Goto declaration in source

(Glib.Properties.Property_String)

    Translation_Domain_Property : constant Glib.Properties.Property_String;

# Subprograms & Entries

### Get_Type

- Goto spec in source
- Goto body in source

    function Get_Type return GType;

### Gtk_New

- Goto spec in source

    procedure Gtk_New (Builder: out Gtk_Builder);

### Initialize

- Goto spec in source

    procedure Initialize (Builder: access Gtk_Builder_Record'Class);

Creates a new Gtk_Builder object.

### Error_Quark

- Goto spec in source
- Goto body in source

    function Error_Quark return GQuark;

### Add_From_File

- Goto spec in source

    function Add_From_File (Builder: access Gtk_Builder_Record;Filename: String) return Glib.Error.GError;

Parses a file containing a Gtk_Builder UI definition and merges it with the current contents of builder. Returns: A GError if an error occured, otherwise null.

### Add_From_String

- Goto spec in source

    function Add_From_String (Builder: access Gtk_Builder_Record;Buffer: String;Length: Gsize) return Glib.Error.GError;

Parses a string containing a Gtk_Builder UI definition and merges it with the current contents of Builder. Returns: A GError if an error occured, otherwise null.

### Get_Object

- Goto spec in source

    function Get_Object (Builder: access Gtk_Builder_Record;Object_Name: String) return Glib.Object.GObject;

Gets the object named Object_Name. Note that this function does not increment the reference count of the returned object. Returns null if it could not be found in the object tree. See also Get_Widget below.

### Get_Widget

- Goto spec in source

    function Get_Widget (Builder: access Gtk_Builder_Record;Name: String) return Gtk.Widget.Gtk_Widget;

Utility function to retrieve a widget created by Builder. Returns null if no widget was found with the given name.

### Connect_Signals_Full

- Goto spec in source

    procedure Connect_Signals_Full (Builder: access Gtk_Builder_Record;Signal_Function: Gtk_Builder_Connect_Func;User_Data: System.Address);

This function can be thought of the interpreted language binding version of Connect_Signals, except that it does not require GModule to function correctly.