GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Oct 31, 2014 8:27 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: glade3.15, assertion `GTK_IS_WIDGET (widget)' failed
PostPosted: Thu Jun 06, 2013 11:55 pm 
Offline

Joined: Thu Jun 06, 2013 2:20 am
Posts: 2
I'm trying to get first example program in micah carrick's Glade Tutorial http://www.micahcarrick.com/gtk-glade-tutorial-part-1.html to run on linux (xubuntu 12.10) following the instructions I create a top level window and modified signal to call on_destroy_event

I then compiled this file tutorial.c:
Code:
#include <gtk/gtk.h>

void
on_window_destroy (GtkObject *object, gpointer user_data)
{
    gtk_main_quit ();
}

int
main (int argc, char *argv[])
{
    GtkBuilder      *builder;
    GtkWidget       *window;

    gtk_init (&argc, &argv);

    builder = gtk_builder_new ();
    gtk_builder_add_from_file (builder, "tutorial.xml", NULL);
    window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
    gtk_builder_connect_signals (builder, NULL);

    g_object_unref (G_OBJECT (builder));
       
    gtk_widget_show (window);               
    gtk_main ();

    return 0;
}

gcc -o tutorial tutorial.c -Wall -g `pkg-config gtk+-2.0 --cflags --libs`

executing from terminal
./tutorial
no window appears but get this error message:
(tutorial:10740): Gtk-CRITICAL **: IA__gtk_widget_show: assertion `GTK_IS_WIDGET (widget)' failed

what am I doing wrong, etc. ?


Top
 Profile  
 
 Post subject: Re: glade3.15, assertion `GTK_IS_WIDGET (widget)' failed
PostPosted: Fri Jun 07, 2013 1:26 pm 
Offline

Joined: Thu Jun 06, 2013 2:20 am
Posts: 2
had to do 2 things change from tutorial.xml to tutorial.glade
gtk_builder_add_from_file (builder, "tutorial.glade", NULL);

and compile with -export-dynamic
gcc -o tutorial tutorial.c -Wall -g `pkg-config gtk+-2.0 --cflags --libs` -export-dynamic


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group