Gtk2::devel

Gtk2::devel is the internal workings of the gtk2-perl language bindings.
Download

Gtk2::devel Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • gtk2-perl team
  • Publisher web site:
  • http://search.cpan.org/~tsch/Gtk2-1.183/tools/genkeysyms.pl

Gtk2::devel Tags


Gtk2::devel Description

Gtk2::devel is the internal workings of the gtk2-perl language bindings. Gtk2::devel is the internal workings of the gtk2-perl language bindings.This document is a supplement to Glib::devel, and assumes you have read and understood all about how the base Glib bindings work. Most of this will seem like nonsense, otherwise.Here we focus on the ways in which Gtk2 extends Glib's concepts for binding the Gtk+ C libraries to perl, a methodology and set of tools you can use to wrap your own GObject-based libraries.GtkObjectGtkObject adds the idea of a floating reference to GObject. A GObject is created with one reference which must be explicitly removed by its owner. GtkObject has a floating reference which is sunk by the code which wants to own it. This makes it less painful to create lots of objects in a row (you don't have to unref them).To allow for this difference in procedure for taking ownership of an object, Glib allows you to register a "sink" function for a particular class. When asked to create a wrapper that owns the object, gperl_new_object will compare the list of registered sink functions with the type of the object; if the object is descended from a type, that sink function will be run on the object. The default one is g_object_unref(), of course. (this is inspired by pygtk.)Thus, in Gtk2::Object's boot code, we register gtk_object_sink as the sink func for types derived from GtkObject. Now all wrappers for these types will be owned the proper way.Of course, since gtk_object_sink() does nothing if the object isn't floating, it doesn't hurt anything if you always call gperl_new_object with "own" set to TRUE. So, to make life a little easier, Gtk2 defines another function SV * gtk2perl_new_gtkobject (GtkObject * o);Which does nothing more than { return gperl_new_object (G_OBJECT (o), TRUE); }It's also important to know that this is largely done for you by the typemap.Requirements:· Perl Requirements: · Perl


Gtk2::devel Related Software