About all my projects
Gnome::Gtk3::Buildable

Gnome::Gtk3::Buildable

Interface for objects that can be built by Gnome::Gtk3::Builder

Description

Gnome::Gtk3::Buildable allows objects to extend and customize their deserialization from Gnome::Gtk3::Builder UI descriptions. The interface includes methods for setting names and properties of objects, parsing custom tags and constructing child objects.

The Gnome::Gtk3::Buildable 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 Gnome::Gtk3::Builder. There should be very little need for applications to call any of these functions directly.

Synopsis

Declaration

unit role Gnome::Gtk3::Buildable;

Methods

add-child

Adds a child to buildable. type is an optional string describing how the child should be added.

method add-child ( N-GObject() $builder, N-GObject() $child, Str $type )
  • a Gnome::Gtk3::Builder

  • $child; child to add

  • $type; kind of child or undefined

buildable-get-name

Gets the name of the buildable object.

Gnome::Gtk3::Builder sets the name based on the [GtkBuilder UI definition][BUILDER-UI] used to construct the buildable.

Returns: the name set with set-name()

method buildable-get-name ( --> Str )

Note: The method name deviates from the convention in the Raku modules because it would clash with the .get-name() defined in Gnome::Gtk3::Widget.

buildable-set-name

Sets the name of the buildable object.

method buildable-set-name ( Str $name )
  • $name; name to set

Note: The method name deviates from the convention in the Raku modules because it would clash with the .set-name() defined in Gnome::Gtk3::Widget.

construct-child

Constructs a child of buildable with the name name.

Gnome::Gtk3::Builder calls this function if a “constructor” has been specified in the UI definition.

Returns: the constructed child

method construct-child ( N-GObject() $builder, Str $name --> N-GObject )
  • $builder; Gnome::Gtk3::Builder used to construct this object

  • $name; name of child to construct

custom-finished

This is similar to parser-finished() but is called once for each custom tag handled by the buildable.

method custom-finished (
  N-GObject() $builder, N-GObject() $child, Str $tagname,
  Pointer $data
)
  • $builder; a Gnome::Gtk3::Builder

  • $child; child object or undefined for non-child tags

  • $tagname; the name of the tag

  • $data; user data created in custom-tag-start

custom-tag-end

This is called at the end of each custom element handled by the buildable.

method custom-tag-end (
  N-GObject() $builder, N-GObject() $child, Str $tagname,
  Pointer $data
)
  • $builder; Gnome::Gtk3::Builder used to construct this object

  • $child; child object or undefined for non-child tags

  • $tagname; name of tag

  • $data; (type gpointer): user data that will be passed in to parser functions

custom-tag-start

This is called for each unknown element under <child>.

Returns: True if a object has a custom implementation, False if it doesn't.

method custom-tag-start (
  N-GObject() $builder, N-GObject() $child, Str $tagname,
  GMarkupParser $parser, Pointer $data --> Bool
)
  • $builder; a Gnome::Gtk3::Builder used to construct this object

  • $child; child object or undefined for non-child tags

  • $tagname; name of tag

  • $parser; a Gnome::Gtk3::MarkupParser to fill in

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

get-internal-child

Get the internal child called childname of the buildable object.

Returns: the internal child of the buildable object

method get-internal-child (
  N-GObject() $builder, Str $childname --> N-GObject
)
  • $builder; a Gnome::Gtk3::Builder

  • $childname; name of child

parser-finished

Called when the builder finishes the parsing of a [GtkBuilder UI definition][BUILDER-UI]. Note that this will be called once for each time gtk-builder-add-from-file() or gtk-builder-add-from-string() is called on a builder.

method parser-finished ( N-GObject() $builder )
  • $builder; a Gnome::Gtk3::Builder

set-buildable-property

Sets the property name name to value on the buildable object.

method set-buildable-property (
  N-GObject() $builder, Str $name, N-GObject() $value
)
  • $builder; a Gnome::Gtk3::Builder

  • $name; name of property

  • $value; value of property

buildable-get-name

Gets the name of the buildable object.

Gnome::Gtk3::Builder sets the name based on the Gnome::Gtk3::Builder UI definition used to construct the buildable.

Returns: the name set with buildable-set-name()

method buildable-get-name ( --> Str )

buildable-set-name

Sets the name of the buildable object.

method buildable-set-name ( Str $name )
  • $name; name to set

add-child

Adds a child to buildable. type is an optional string describing how the child should be added.

method add-child ( N-GObject $builder, N-GObject $child, Str $type )
  • $builder; a Gnome::Gtk3::Builder

  • $child; child to add

  • $type; kind of child or undefined

construct-child

Constructs a child of buildable with the name name.

Gnome::Gtk3::Builder calls this function if a “constructor” has been specified in the UI definition.

Returns: the constructed child

method construct-child ( N-GObject $builder, Str $name --> N-GObject )
  • $builder; Gnome::Gtk3::Builder used to construct this object

  • $name; name of child to construct

custom-finished

This is similar to parser-finished() but is called once for each custom tag handled by the buildable.

method custom-finished ( N-GObject $builder, N-GObject $child, Str $tagname, Pointer $data )
  • $builder; a Gnome::Gtk3::Builder

  • $child; (allow-none): child object or undefined for non-child tags

  • $tagname; the name of the tag

  • $data; user data created in custom-tag-start

custom-tag-end

This is called at the end of each custom element handled by the buildable.

method custom-tag-end (
  N-GObject $builder, N-GObject $child,
  Str $tagname, Pointer $data
)
  • $builder; Gnome::Gtk3::Builder used to construct this object

  • $child; (allow-none): child object or undefined for non-child tags

  • $tagname; name of tag

  • $data; (type gpointer): user data that will be passed in to parser functions

custom-tag-start

This is called for each unknown element under <child>.

Returns: True if a object has a custom implementation, False if it doesn't.

method custom-tag-start ( N-GObject $builder, N-GObject $child, Str $tagname, GMarkupParser $parser, Pointer $data --> Int )
  • $builder; a Gnome::Gtk3::Builder used to construct this object

  • $child; (allow-none): child object or undefined for non-child tags

  • $tagname; name of tag

  • $parser; (out): a GMarkupParser to fill in

  • $data; (out): return location for user data that will be passed in to parser functions

get-internal-child

Get the internal child called childname of the buildable object.

Returns: (transfer none): the internal child of the buildable object

method get-internal-child ( N-GObject $builder, Str $childname --> N-GObject )
  • $builder; a Gnome::Gtk3::Builder

  • $childname; name of child

parser-finished

Called when the builder finishes the parsing of a [Gnome::Gtk3::Builder UI definition][BUILDER-UI]. Note that this will be called once for each time gtk-builder-add-from-file() or gtk-builder-add-from-string() is called on a builder.

method parser-finished ( N-GObject $builder )
  • $builder; a Gnome::Gtk3::Builder

set-buildable-property

Sets the property name name to value on the buildable object.

method set-buildable-property (
  N-GObject $builder, Str $name, N-GObject $value
)
  • $builder; a Gnome::Gtk3::Builder

  • $name; name of property

  • $value; value of property