Not really understand on subclassing



Hello everyone:

I got problems on expand a Goo::Canvas class. I just make a simple class like this:


######################################
package test::CanvasExpand;

use strict;
use Glib::Object::Subclass 'Goo::Canvas::Rect';

sub foo {
    print "foo called\n";   
}

1;
######################################

while I call constructor with the parameters of Goo::Canvas::Rect:

######################################
my $elem = test::CanvasExpand->new(
    $root, 100, 100, 400, 400,
    'line-width'   => 10,
    'radius-x'     => 20,
    'radius-y'     => 10,
    'stroke-color' => 'yellow',
    'fill-color'   => 'red'
);
######################################

It says that:

new method expects name => value pairs (odd number of arguments detected)



Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up now.


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