Methods

new

Please note that this class is mostly not instantiated directly but is used indirectly when child classes are instantiated.

multi method new ( :$native-object! )

Create a Raku object using a native object from elsewhere. $native-object can be a N-Object or a Raku object like Gnome::Gtk3::Button.

# Some set of radio buttons grouped together
my Gnome::Gtk3::RadioButton $rb1 .= new(:label('Download everything'));
my Gnome::Gtk3::RadioButton $rb2 .= new(
  :group-from($rb1), :label('Download core only')
);

# Get all radio buttons in the group of button $rb2
my Gnome::GObject::SList $rb-list .= new(:native-object($rb2.get-group));
loop ( Int $i = 0; $i < $rb-list.g_slist_length; $i++ ) {
  # Get button from the list
  my Gnome::Gtk3::RadioButton $rb .= new(
    :native-object($rb-list.nth-data-gobject($i))
  );

  # If radio button is selected (=active) ...
  if $rb.get-active == 1 {
    ...

    last;
  }
}

get-class-gtype

Return class's type code after registration. this is like calling Gnome::GObject::Type.new().g_type_from_name(GTK+ class type name).

method get-class-gtype ( --> GType )

get-class-name

Return native class name.

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

is-valid

Returns True if native object is valid. When False, the native object is undefined and errors will occur when this instance is used.

method is-valid ( --> Bool )

clear-object

Clear the error and return data to memory pool. The error object is not valid after this call and is-valid() will return False.

method clear-object ()

Internally used methods

_set-builder

Used by Gnome::Gtk3::Builder to register itself. Its purpose is twofold

method _set-builder ( Gnome::Gtk3::Builder$builder )

_get-builders

Used by Gnome::GObject::Object to search for an object id.

method _get-builders ( --> Array )

_set-test-mode

Used to turn test mode on or off. This is done by Gnome::T. When turned on, an event loop can not be started by calling Gnome::Gtk3::Main.new.main() and can only be started by Gnome::T.

method _set-test-mode ( Bool $mode )

_get-test-mode

Get current state.

method _get-test-mode ( --> Bool )

_wrap-native-type

Used by many classes to create a Raku instance with the native object wrapped in

method _wrap-native-type (
  Str:D $type where ?$type, N-Object:D $no
  --> Any
)

_wrap-native-type-from-no

As with _wrap-native-type() this method is used by many classes to create a Raku instance with the native object wrapped in.

method _wrap-native-type-from-no (
  N-Object $no, Str:D $match = '', Str:D $replace = '', :child-type?
  --> Any
) {