-
-
08 Jun 2014 10:25:52 UTC
- Distribution: Glib-Ex-ObjectBits
- Module version: 16
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Issues
- Testers (3434 / 29 / 0)
- Kwalitee
Bus factor: 1- 68.02% Coverage
- License: gpl_3
- Perl: v5.8.0
- Activity
24 month- Tools
- Download (51.52KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Kevin Ryde
- Dependencies
- Devel::GlobalDestruction
- Glib
- Glib::Object::Subclass
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Glib::Ex::SignalBits -- miscellaneous Glib signal helpers
SYNOPSIS
use Glib::Ex::SignalBits;
FUNCTIONS
Accumulators
The following functions are designed for use as the "accumulator" in a signal created by
Glib::Object::Subclass
orGlib::Type->register_object()
. The functions are trivial, but giving them names gets the right sense and order for the return values.($cont, $ret) = Glib::Ex::SignalBits::accumulator_first ($hint, $acc, $ret)
-
Stop at and return the value from the first handler.
($cont, $ret) = Glib::Ex::SignalBits::accumulator_first_defined ($hint, $acc, $ret)
-
Stop at and return the first
defined
value, in the Perl sense. This means the first non-NULLGlib::Object
,Glib::String
, etc, or first non-undef
Glib::Scalar
.
Example
use Glib::Object::Subclass 'Gtk2::Widget', signals => { 'make-title' => { param_types => ['Glib::Int'], return_type => 'Glib::String', flags => ['run-last'], class_closure => \&my_default_make_title, accumulator => \&Glib::Ex::SignalBits::accumulator_first_defined, }, };
Don't forget to
use Glib::Ex::SignalBits
because a non-existent function in a signal accumulator will cause anabort()
from Perl-Glib (as of version 1.220).EXPORTS
Nothing is exported by default, but each function can be requested in usual
Exporter
style,use Glib::Ex::SignalBits 'accumulator_first'; use Glib::Object::Subclass ... accumulator => \&accumulator_first
SEE ALSO
Glib::Object, Glib::Object::Subclass, Glib::Signal, Glib::Ex::SignalIds, Glib::Ex::FreezeNotify
HOME PAGE
http://user42.tuxfamily.org/glib-ex-objectbits/index.html
LICENSE
Copyright 2009, 2010, 2011, 2012, 2014 Kevin Ryde
Glib-Ex-ObjectBits is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Glib-Ex-ObjectBits is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Glib-Ex-ObjectBits. If not, see http://www.gnu.org/licenses/.
Module Install Instructions
To install Glib::Ex::ObjectBits, copy and paste the appropriate command in to your terminal.
cpanm Glib::Ex::ObjectBits
perl -MCPAN -e shell install Glib::Ex::ObjectBits
For more information on module installation, please visit the detailed CPAN module installation guide.