S
Samuel Abels
Hello,
I am trying to implement a module derived from Glib::Object. This
works fine, except for when I want my module to emit a self-defined
signal.
I know from the Gtk-Perl documentation that the signal has to be
registered first.
So this is what I figured should be right according to the docs:
------------------------------------------------
#!/usr/bin/env perl
package TestClass;
use strict;
use Gtk2 '-init';
use vars qw(@ISA $VERSION);
@ISA = qw(Glib::Object);
$VERSION = 0.01;
use Glib::Object::Subclass
TestClass::,
signals => {
my_new_signal => {
class_closure => sub { print "BLA\n" },
flags => [qw(run-first)],
return_type => undef,
param_types => []
}
};
sub new {
[...];
}
------------------------------------------------
Unfortunately, this produces an error message:
Uncaught exception from user code:
package RouterInterfaceConfig has not been registered with
GPerl at /usr/lib/perl5/Glib/Object/Subclass.pm line 225.
BEGIN failed--compilation aborted at ./test.pl line 11.
Google was not helpful. I'm clueless.
Any hints?
Thanks,
Samuel
I am trying to implement a module derived from Glib::Object. This
works fine, except for when I want my module to emit a self-defined
signal.
I know from the Gtk-Perl documentation that the signal has to be
registered first.
So this is what I figured should be right according to the docs:
------------------------------------------------
#!/usr/bin/env perl
package TestClass;
use strict;
use Gtk2 '-init';
use vars qw(@ISA $VERSION);
@ISA = qw(Glib::Object);
$VERSION = 0.01;
use Glib::Object::Subclass
TestClass::,
signals => {
my_new_signal => {
class_closure => sub { print "BLA\n" },
flags => [qw(run-first)],
return_type => undef,
param_types => []
}
};
sub new {
[...];
}
------------------------------------------------
Unfortunately, this produces an error message:
Uncaught exception from user code:
package RouterInterfaceConfig has not been registered with
GPerl at /usr/lib/perl5/Glib/Object/Subclass.pm line 225.
BEGIN failed--compilation aborted at ./test.pl line 11.
Google was not helpful. I'm clueless.
Any hints?
Thanks,
Samuel