unit class GTK::V3::Gtk::GtkBin; also is GTK::V3::Gtk::GtkContainer;
The module GtkBin is not used directly but its methods can be used by its child modules. Below is an example using a GtkButton
which is a direct descendant of GtkBin
. Here it is also clear that a button is also a container which in principle can hold anything but by default it holds a label. The method gtk-container-add()
comes from GtkContainer
and get-child()
comes from GtkBin
.
my GTK::V3::Gtk::GtkLabel $label .= new(:label<pqr>); my GTK::V3::Gtk::GtkButton $button .= new(:empty); $button.gtk-container-add($label); $l($button2.get-child); is $l.get-text, 'pqr', 'text label from button 2';
Of course, it is easier to do the next
my GTK::V3::Gtk::GtkButton $button .= new(:label<pqr>);
method gtk_bin_get_child ( --> N-GObject )
Gets the child of the GtkBin, or Any
if the bin contains no child widget.