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 6610759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:52:52+00:00 2026-05-25T19:52:52+00:00

I am trying to master the GObject Library. So I tried to make a

  • 0

I am trying to master the GObject Library. So I tried to make a simple Gtk+ Custom Widget by inheriting from GtkHBox. I can’t figure out what the problem is or even where the problem is so I’ll have to paste the entire code. Here is the code:

notetab.h

#ifndef NOTETAB_H
#define NOTETAB_H

G_BEGIN_DECLS

#define PRO_NOTE_TAB(obj) GTK_CHECK_CAST(obj, pro_note_tab_get_type (), ProNoteTab)
#define GTK_CPU_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, pro_note_tab_get_type(), ProNoteTabClass)
#define GTK_IS_CPU(obj) GTK_CHECK_TYPE(obj, pro_note_tab_get_type())

typedef struct _ProNoteTab ProNoteTab;
typedef struct _ProNoteTabClass ProNoteTabClass;

struct _ProNoteTab
{
    GtkWidget hbox;
    GtkObject parent_instance;
    GtkLabel label;
    GtkButton cbtn;
};

struct _ProNoteTabClass
{
    GtkHBoxClass parent_class;
};

GtkType pro_note_tab_get_type(void);
GtkWidget* pro_note_tab_new(void);

G_END_DECLS

#endif

notetab.c

#include "common.h"
#include "notetab.h"

GtkType pro_note_tab_get_type()
{
    GtkType pro_note_tab_type = 0;

    if (!pro_note_tab_get_type)
    {
        static const GtkTypeInfo pro_note_tab_info =
        {
            "ProNoteTab",
            sizeof(ProNoteTab),
            sizeof(ProNoteTabClass),
            (GtkClassInitFunc) NULL,
            (GtkObjectInitFunc) NULL,
            NULL,
            NULL,
            (GtkClassInitFunc) NULL
        };

        pro_note_tab_type = gtk_type_unique(GTK_TYPE_WIDGET, &pro_note_tab_info);
    }

    return pro_note_tab_type;
}

GtkWidget* pro_note_tab_new(void)
{
    return GTK_WIDGET(gtk_type_new(pro_note_tab_get_type()));
}

Now the program compiles perfectly fine. But the error I get at runtime is:

GTK_CRITICAL**: IA__gtk_type_new : assertion GTK_TYPE_IS_OBJECT(type) failed
GTK_CRITICAL**: IA__gtk_container_add : assertion GTK_IS_WIDGET(widget) failed

What am I doing wrong? Or even I what in the world is this error about?

  • 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-25T19:52:53+00:00Added an answer on May 25, 2026 at 7:52 pm

    According to the docs, gtk_type_unique is “deprecated and should not be used in newly-written code”.

    Use g_type_register_static instead. More so if you are trying to master GObject, not old Gtk+.

    Anyway, I’d say that your error is due to some of the NULL function pointers you are setting, some are probably not optional, but this is poorly documented.

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

Sidebar

Related Questions

Trying to create Database as follows: USE Master GO IF NOT EXISTS(SELECT [Name] FROM
I'm trying to pass a ViewData object from a master page to a view
I am trying to reference the jQuery library in my master page like so:
I am trying to generate an output XML file from a master xml file
I have spent a couple days trying to figure out why my asp master
What I am trying to do is seemingly simple. I have a master report
i'm new with RoR and i'm trying to make a master-datail: User -Lugar(place) My
So I am trying to simply load a .css file from within the master
Here is my transcript from trying to merge my bugfix branch onto my master
i'm trying to make my site master page ( views/shared/site.master ) strongly typed. eg.

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.