Writing a Module for SourceView with GOI

Hi all,
I try to write a Perl Module for SourceView.
My code is very basic so far:
package Gtk3::SourceView;
use strict;
use warnings;
use Glib::Object::Introspection;
our $VERSION = "0.01";
sub import {
        basename => "GtkSource",
        version => "3.0",
        package => "Gtk3::SourceView",
Using the modul I noticed two problems:
1) If I write "my $lm = Gtk3::SourceView::LanguageManager->get_default();" I get the warn: "*** Gtk3::SourceView::LanguageManager::get_default: passed too many parameters (expected 0, got 1); ignoring excess at test.pl line 22." Surprisingly "my $lm = Gtk3::SourceView::LanguageManager::get_default();" works without problems.
2) If I set the language with  "my $lang = $lm->get_language("perl");" and set the buffer with "$buffer1->set_language("$lang");" I get the error "`Gtk3::SourceView::La...' is not of type Gtk3::SourceView::Language at /usr/local/lib/x86_64-linux-gnu/perl/5.20.2/Glib/Object/Introspection.pm line 67."
Ther returned reference from the get_language function ist "Gtk3::SourceView::Language=HASH(0x2026d98)"
Perhaps someone has an idea? Sorry if the questions are too easy but it is my first attempt to write a GTK3 binding with GOI. If someone knows a good introduction for doing this, I would be very thankful.
Thanks a lot,

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