Gtk2::Builder(3) User Contributed Perl Documentation Gtk2::Builder(3)

Gtk2::Builder - wrapper for GtkBuilder

Glib::Object
+----Gtk2::Builder

integer = $builder->add_from_file ($filename)

$filename (localized file name)

May croak with a Glib::Error in $@ on failure.

integer = $builder->add_from_string ($buffer)

$buffer (string)

May croak with a Glib::Error in $@ on failure.

integer = $builder->add_objects_from_string ($buffer, $first_object_id, ...)

  • $buffer (string)
  • $first_object_id (string)
  • ... (list)

Since: gtk+ 2.14

$builder->connect_signals ($user_data)

$builder->connect_signals ($user_data, $package)

$builder->connect_signals ($user_data, %handlers)

There are four ways to let Gtk2::Builder do the signal connecting work for you:

"$builder->connect_signals ($user_data)"
When invoked like this, Gtk2::Builder will connect signals to functions in the calling package. The callback names are specified in the UI description.
"$builder->connect_signals ($user_data, $package)"
When invoked like this, Gtk2::Builder will connect signals to functions in the package $package.
"$builder->connect_signals ($user_data, $object)"
When invoked like this, Gtk2::Builder will connect signals to method calls against the object $object.
"$builder->connect_signals ($user_data, %handlers)"
When invoked like this, %handlers is used as a mapping from handler names to code references.

$builder->connect_signals_full ($func, $user_data=undef)

  • $func (scalar)
  • $user_data (scalar)

$name (string)

$builder->set_translation_domain ($domain)

$domain (string or undef)

'translation-domain' (string : default undef : readable / writable / private / static-nick / static-blurb)
The translation domain used by gettext

Gtk2, Glib::Object

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.

2022-05-29 perl v5.36.0