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



Thanks a lot for your answer. Unfortunately it still doesn't work.
 
I tried the following codes:
package Provider;
use Glib ("TRUE","FALSE");
use Gtk3::SourceView;
use base 'Gtk3::SourceView::CompletionProvider';
sub new {
    return bless 'Gtk3::SourceView::CompletionProvider';
}
with this I get the following error:
*** unhandled exception in callback:
***   Can't bless non-reference value at ./edit.pl line 16.
***  ignoring at /usr/local/share/perl/5.20.2/Gtk3.pm line 546.
 
Then I tried the following:
package Provider;
use Glib ("TRUE","FALSE");
use Gtk3::SourceView;
use base 'Gtk3::SourceView::CompletionProvider';
sub new {
    my $obj = {};
    bless $obj, 'Gtk3::SourceView::CompletionProvider';
    return $obj;
}
with the following error:
*** unhandled exception in callback:
***   Gtk3::SourceView::CompletionProvider=HASH(0xcb3668) is not a proper Glib::Object (it doesn't contain the right magic) at /usr/local/lib/x86_64-linux-gnu/perl/5.20.2/Glib/Object/Introspection.pm line 67.
***  ignoring at /usr/local/share/perl/5.20.2/Gtk3.pm line 546.

 
I am very clueless. Nevertheless thanks a lot for your help.
 
Gesendet: Samstag, 21. Mai 2016 um 21:58 Uhr
Von: oldtechaa <oldtechaa gmail com>
An: gtk-perl-list gnome org
Betreff: Re: Writing a class from type Gtk3::SourceView::CompletionProvider

To "use base", you'll have to return a blessed object of your "base" from your constructor. Like this:

sub new {
    return bless Gtk3::SourceView::CompletionProvider;
}

This will return a Gtk3::SourceView::CompletionProvider with the "Provider" functions added to it. See "perl -f bless" for more on blessing and what it really does.

_______________________________________________ gtk-perl-list mailing list gtk-perl-list gnome org https://mail.gnome.org/mailman/listinfo/gtk-perl-list
 
 


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