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



I looked up the hierarchy and I see what you mean about no constructor. It seems, in fact, that CompletionProviders can only be constructed by the SourceView itself. The course I probably would recommend is to use your class to subclass every CompletionProvider returned by your SourceView's Completion object's get_providers() function. Here are the links:

https://developer.gnome.org/gtksourceview/stable/GtkSourceView.html#gtk-source-view-get-completion

https://developer.gnome.org/gtksourceview/stable/GtkSourceCompletion.html#gtk-source-completion-get-providers

When get_providers() returns the list, you can use each element and pass it to your class constructor, where it can be blessed. Then your constructor would look more like this:

sub new {
    return bless $_[1];
}

This way you return a blessed version of the class you pass to it from wherever you call your constructor.



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