Re: How to store perl object in GObject's property?





2010/4/15 Xi Yang <jiandingzhe msn com>
For example:

###### in Extended.pm ######
package Extended;
use strict;
use test::Foo;

use Glib::Object::Subclass 'Goo::Canvas::Rect',
ÂÂÂ properties => [
ÂÂÂ ÂÂÂ Glib::ParamSpec->object(
ÂÂÂ ÂÂÂ ÂÂÂ 'foo','','',
ÂÂÂ ÂÂÂ ÂÂÂ 'Foo',
ÂÂÂ ÂÂÂ ÂÂÂ [qw/readable writable/]
ÂÂÂ ÂÂÂ )
ÂÂÂ ]
;
Glib::ParamSpec->object is for GObject and derivatives, since you just want to pass a pure perl object useÂGlib::ParamSpec->scalar ($name, $nick, $blurb, $flags) instead.
Â
--
Emmanuel Rodriguez


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