Renard::Curie::Helper - Collection of helper utilities for Gtk3 and Glib
version 0.002
gval
classmethod gval( $glib_typename, $value )
Given a Glib type name, wraps a Perl value in an object that can be passed to other Glib-based functions.
$glib_typename
The name of a type under the Glib:: namespace. For example, passing in "int" gives a wrapper to the gint C type which is known as Glib::Int in Perl.
Glib::
"int"
gint
Glib::Int
$value
The value to put inside the wrapper.
See Glib::Object::Introspection::GValueWrapper in Glib::Object::Introspection for more information.
classmethod genum( $package, $sv )
Returns an enumeration value of type $package which contains the matching enum value given in $sv as a string.
$package
$sv
The package name of a Glib enumeration.
A string representation of the enumeration value.
For example, for GtkPackType enum, we set $package to 'Gtk3::PackType' and $sv to 'GTK_PACK_START'. This can be passed on to other Glib::Object::Introspection methods.
'Gtk3::PackType'
'GTK_PACK_START'
classmethod callback( $invocant, $callback_name, @args )
A helper function to redirect to other callback functions. Given an $invocant and the name of the callback function, $callback_name, which is defined in the package of $invocant, calls that function with arguments ( @args, $invocant ).
$invocant
$callback_name
( @args, $invocant )
For example, if we are trying to call the callback function Target::Package::on_event_cb and $target is a blessed reference of type Target::Package, then by using
Target::Package::on_event_cb
$target
Target::Package
Renard::Curie::Helper->callback( $target, on_event_cb => @rest_of_args );
effectively calls
Target::Package::on_event_cb( @rest_of_args, $target );
Project Renard
This software is copyright (c) 2016 by Project Renard.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Renard::Curie, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Renard::Curie
CPAN shell
perl -MCPAN -e shell install Renard::Curie
For more information on module installation, please visit the detailed CPAN module installation guide.