Hi,
I'm having some troubles to handle GString types through
Glib::Object::Introspection. Whenever I try to access GString type I
see the following error printed at the console:
*** unhandled exception in callback:
*** GType GString (156083704) is not registered with gperl at
/usr/local/lib/perl/5.12.4/Glib/Object/Introspection.pm line 57.
*** ignoring at /usr/local/share/perl/5.12.4/Gtk3.pm line 104.
The following example (also available in attachment) reproduces the error:
#!/usr/bin/env perl
use strict;
use warnings;
use Gtk3 -init;
use Gtk3::WebKit;
sub main {
my ($url) = @ARGV;
$url ||= 'http://www.google.com/';
my $view = Gtk3::WebKit::WebView->new();
$view->signal_connect('notify::load-status' => sub {
return unless $view->get_uri and $view->get_load_status eq 'finished';
# webkit_web_data_source_get_data returns a GString which causes Perl to
# generate the following error message:
# *** unhandled exception in callback:
# *** GType GString (177313392) is not registered with gperl
at /usr/local/lib/perl/5.12.4/Glib/Object/Introspection.pm line 57.
# *** ignoring at /usr/local/share/perl/5.12.4/Gtk3.pm line 104.
my $data = $view->get_focused_frame->get_data_source->get_data;
Gtk3->main_quit();
});
$view->load_uri($url);
my $window = Gtk3::OffscreenWindow->new();
$window->add($view);
$window->show_all();
Gtk3->main();
return 0;
}
exit main() unless caller;
__END__
In the past I was able to access GString without problems. What should
I do in order to register the GString type with Perl?
--
Emmanuel Rodriguez
Attachment:
gstring.pl
Description: Binary data