Re: could not find signal invocation hint
- From: muppet <scott asofyet org>
- To: James Muir <hemlock vtlink net>
- Cc: gtk-perl-list gnome org
- Subject: Re: could not find signal invocation hint
- Date: Mon, 28 Nov 2005 17:51:47 -0500
On Nov 28, 2005, at 1:09 PM, James Muir wrote:
I am trying to subclass a subclass of a Gnome2::Canvas::Group, and
I can't get a method to call its parent method. I understand that
SUPER:: is not available, but the online documentation baffles me
and I'm getting the "could not find signal invocation hint" error.
I've tried alot of things without success, even fiddling with the
signal param_types. Here is my test case. I've made this case as
small as I could get it.
It's not merely that SUPER:: is not available for Glib::Object
methods --- you're confusing events, C vfuncs, and normal perl methods.
SUPER *is* available for plain old perl methods. Since you're
creating Fruit::ripen as a plain old perl method, overriding it from
perl in Orange, and calling it from perl, all of the standard perl
tricks are available.
package main;
...
my $fruit = Gnome2::Canvas::Item->new($canvas->root,'Orange',x=>0,
y=>0);
$fruit->ripen();
...
package Fruit;
...
sub ripen
{
...
}
...
package Orange;
...
use Glib::Object::Subclass
Fruit::,
# Unsure how to fiddle with the signals in this case. ???
signals=>{
event => \&ripen,
This doesn't do what you think it does. This sets up Orange::ripen()
to be called for every emission of Gnome2::Canvas::Item's "event"
signal --- however, you're calling $fruit->ripen directly, which is
completely different. In that case, there is no signal emission, so
there is no invocation hint for signal_chain_from_overridden() to
look up to figure out whom to call.
Remove this signal setup.
},
...
sub ripen
{
my $self = shift(@_);
my $rect = Gnome2::Canvas::Item->new($self,'Gnome2::Canvas::Rect',
x1=>110, y1=>110,
x2=>150, y2=>150,
fill_color=>$self->get('color'));
$self->signal_chain_from_overridden; # Produces the error.
$self->SUPER::ripen; # does what you want.
--
However, like all drugs, PANEXA can produce some notable side
effects, all of which are probably really, really terrific and
nothing that anyone should be concerned about, let alone notify any
medical regulatory commission about.
-- http://www.panexa.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]