Re: Writing a class from type Gtk3::SourceView::CompletionProvider



GLib-GObject-WARNING **: cannot derive 'Provider' from
non-fundamental parent type 'GtkSourceCompletionProvider'
at /usr/local/lib/x86_64-linux-gnu/perl/5.20.2/Glib/Object/Subclass.pm
line 235.

Definitely seems like the problem is that GktSourceCompletionProvider
is an interface and not a class. Try this (inspired by
https://github.com/GNOME/perl-Glib-Object-Introspection/blob/master/t/interface-implementation.t):


package Provider;

use Glib qw/TRUE FALSE/;
use Gtk3::SourceView;
use Glib::Object::Subclass
    'Glib::Object',
    interfaces => [ 'Gtk3::SourceView::CompletionProvider' ];


# etc etc etc

1;


At least it doesn't throw any errors for me when loaded - haven't taken
it any further. Also note that when you use Glib::Object::Subclass you
don't usually define a new() method yourself - it's automatically
created for you. You can initialize things in an INIT_INSTANCE()
method. If you haven't read the Glib::Object::Subclass tutorial yet you
should do so - sometimes you need to specifically enable signal
handlers, properties, etc in a specific way.

Regards,
Jeremy


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