Glib-Object-Introspection

 view release on metacpan or  search on metacpan

lib/Glib/Object/Introspection.pm  view on Meta::CPAN


  warn "control was down\n" if $event->state * "control-mask";
  warn "control was down\n" if $event->state >= "control-mask";
  warn "control and shift were down\n"
                            if $event->state >= ["control-mask", "shift-mask"];

=head2 Memory Handling

The functions for ref'ing and unref'ing objects and free'ing boxed structures
are not even mapped to Perl, because it's all handled automagically by the
bindings.  Objects will be kept alive so long as you have a Perl scalar
pointing to it or the object is referenced in another way, e.g. from a
container.

The only thing you have to be careful about is the lifespan of non
reference counted structures, which means most things derived from
C<Glib::Boxed>.  If it comes from a signal callback it might be good
only until you return, or if it's the insides of another object then
it might be good only while that object lives.  If in doubt you can
C<copy>.  Structs from C<copy> or C<new> are yours and live as long as
referred to from Perl.



( run in 0.717 second using v1.01-cache-2.11-cpan-39bf76dae61 )