Re: How to extend Canvas Group?



On Wed, 2010-04-07 at 10:44 +0200, Jeffrey Ratcliffe wrote:
Please keep the group in the loop.

2010/4/7 Xi Yang <jiandingzhe msn com>:
package My::Class;
our @isa = qw/Gnome2::Canvas::Group/;

you have to use Glib::Object::Subclass - just modifying the ISA will
give you a Perl object that looks like a GObject, but if you want to
change the behavior by overriding virtual functions, install signals or
properties and in general use the features of the GObject type system
then you have to create a sub-class known to that system. the way to do
that is to use Glib::Object::Subclass.

all GObject-based canvases - Gnome::Canvas, Goo::Canvas and Clutter -
can be sub-classed this way.

Gnome::Canvas it's been deprecated by the GNOME project, though it's
still mildly used because it's portable (the Gnome:: in the package name
doesn't mean anything).

Goo::Canvas is a 2D canvas that uses Cairo; it's not a speed demon, but
it's reasonably portable - though barely maintained.

Clutter is a 3D canvas, using OpenGL (or OpenGL|ES) under the hood. it's
heavily maintained and the underlying C library is used in GNOME for the
new Shell coming for GNOME 3.0 and it's also used on Moblin/MeeGo on
netbooks. the Perl bindings lag a little bit because I haven't had much
time to update them (I either maintain the C library or the Perl
bindings - though cloning myself is an option ;-)).

ciao,
 Emmanuele.

-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]