Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4028602
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:14:25+00:00 2026-05-20T11:14:25+00:00

I try to implement a GType interface in C++ using Glibmm (part of Gtkmm).

  • 0

I try to implement a GType interface in C++ using Glibmm (part of Gtkmm). The object will be passed to an API in C. Unfortunately, the documentation for gtkmm does not cover many details of how it wraps the GObject system.

What I have so far:

class MonaCompletionProvider : public gtksourceview::SourceCompletionProvider, public Glib::Object
{
    public:
        MonaCompletionProvider();
        virtual ~MonaCompletionProvider();

        Glib::ustring get_name_vfunc() const;
        // ... and some more
}

All method and constructor implementations are empty. The code is used like this:

Glib::RefPtr<MonaCompletionProvider> provider(new MonaCompletionProvider());
bool success = completion->add_provider(provider);

success will be false after executing this code and the following message appears in the command line:

(monagui:24831):
GtkSourceView-CRITICAL **:
gtk_source_completion_add_provider:
assertion
`GTK_IS_SOURCE_COMPLETION_PROVIDER
(provider)’ failed

It seems that the underlying gobj() is not aware that it is supposed to implement this interface. If the class does not derive from Glib::Object, gobj() even returns null. I hope that I do not have to write a GObject implementing this interface in C manually.

So what is the correct way to do this? Thanks in advance.

PS: For those who are interested: SourceCompletionProvider

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:14:26+00:00Added an answer on May 20, 2026 at 11:14 am

    Finally, I found a solution.

    Class definition (order of subclasses matters):

    class MonaCompletionProvider : public Glib::Object, public gtksourceview::SourceCompletionProvider {
    ...
    

    Constructor (again, order matters):

    MonaCompletionProvider::MonaCompletionProvider() :
        Glib::ObjectBase(typeid(MonaCompletionProvider)),
        Glib::Object(),
        gtksourceview::SourceCompletionProvider() {
    ...
    

    Solution found by inspecting how it has been done in Guikachu.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I try to implement this simple-as-possible example: Update Content with AJAXRefreshRequest it does
Right now I try to implement the services of my OSGi-application as ds. Unfortunately
I want to try to implement the Tetris Game using TDD. From what I've
I try to implement an option which will save the console output additionally into
I try to implement callback interface with COM techonlogy and have IDL like that:
I try to implement a fluent interface in my 2D game engine. Simplified example
hi we try to implement a process like when a user does something, his
I try to implement a query by using Between Clause,but there is some problem
I try to implement Incognito k-anonymization algorithm in Java. A part of this algorithm
I try to implement a build pipeline using TFS. We already have TFS building

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.