Module: Gtk::Buildable

Defined in:
(unknown)

Overview

GtkBuildable allows objects to extend and customize their deserialization from [GtkBuilder UI descriptions]. The interface includes methods for setting names and properties of objects, parsing custom tags and constructing child objects.

The GtkBuildable interface is implemented by all widgets and many of the non-widget objects that are provided by GTK+. The main user of this interface is Gtk::Builder. There should be very little need for applications to call any of these functions directly.

An object only needs to implement this interface if it needs to extend the Gtk::Builder format or run any extra routines at deserialization time.

Instance Method Summary collapse

Instance Method Details

#add_child(buildable, builder, child, type) ⇒ nil

Parameters:

  • buildable (Gtk::Buildable)

    a Gtk::Buildable

  • builder (Gtk::Builder)

    a Gtk::Builder

  • child (GObject::Object)

    child to add

  • type (String)

    kind of child or nil

Returns:

  • (nil)

#construct_child(buildable, builder, name) ⇒ GObject::Object

Returns the constructed child.

Parameters:

  • buildable (Gtk::Buildable)

    A Gtk::Buildable

  • builder (Gtk::Builder)

    Gtk::Builder used to construct this object

  • name (String)

    name of child to construct

Returns:

  • (GObject::Object)

    the constructed child

#custom_finished(buildable, builder, child, tagname, data) ⇒ nil

Parameters:

  • buildable (Gtk::Buildable)

    a Gtk::Buildable

  • builder (Gtk::Builder)

    a Gtk::Builder

  • child (GObject::Object)

    child object or nil for non-child tags

  • tagname (String)

    the name of the tag

  • data (GObject)

    user data created in custom_tag_start

Returns:

  • (nil)

#custom_tag_end(buildable, builder, child, tagname, data) ⇒ nil

Parameters:

  • buildable (Gtk::Buildable)

    A Gtk::Buildable

  • builder (Gtk::Builder)

    Gtk::Builder used to construct this object

  • child (GObject::Object)

    child object or nil for non-child tags

  • tagname (String)

    name of tag

  • data (GObject)

    user data that will be passed in to parser functions

Returns:

  • (nil)

#custom_tag_start(buildable, builder, child, tagname, parser, data) ⇒ TrueClass

Returns true if a object has a custom implementation, false if it doesn’t.

Parameters:

  • buildable (Gtk::Buildable)

    a Gtk::Buildable

  • builder (Gtk::Builder)

    a Gtk::Builder used to construct this object

  • child (GObject::Object)

    child object or nil for non-child tags

  • tagname (String)

    name of tag

  • parser (GLib::MarkupParser)

    a GMarkup::Parser to fill in

  • data (GObject)

    return location for user data that will be passed in to parser functions

Returns:

  • (TrueClass)

    true if a object has a custom implementation, false if it doesn’t.

#get_internal_child(buildable, builder, childname) ⇒ GObject::Object

Returns the internal child of the buildable object.

Parameters:

Returns:

  • (GObject::Object)

    the internal child of the buildable object

#get_name(buildable) ⇒ String

Returns the name set with gtk_buildable_set_name().

Parameters:

Returns:

  • (String)

    the name set with gtk_buildable_set_name()

#nameString

Gets the name of the buildable object.

Gtk::Builder sets the name based on the

GtkBuilder UI definition][BUILDER-UI

used to construct the buildable.

Returns:

  • (String)

    the name set with gtk_buildable_set_name()

#name=(name) ⇒ nil

Sets the name of the buildable object.

Parameters:

  • name (String)

    name to set

Returns:

  • (nil)

#parser_finished(buildable, builder) ⇒ nil

Parameters:

Returns:

  • (nil)

#set_buildable_property(buildable, builder, name, value) ⇒ nil

Parameters:

  • buildable (Gtk::Buildable)

    a Gtk::Buildable

  • builder (Gtk::Builder)

    a Gtk::Builder

  • name (String)

    name of property

  • value (GObject::Value)

    value of property

Returns:

  • (nil)

#set_name(buildable, name) ⇒ nil

Parameters:

  • buildable (Gtk::Buildable)

    a Gtk::Buildable

  • name (String)

    name to set

Returns:

  • (nil)