LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-26-2008, 02:44 AM   #1
matrix13
Member
 
Registered: Nov 2006
Location: Kerala, India
Distribution: Arch Linux
Posts: 134

Rep: Reputation: 25
Failed to run the tutorial program in Anjuta + Glade


I am using Ubuntu 8.04. I was trying to run the example program 'Hello World' in anjuta (GUI using glade). But, it generated errors.

This was the code that generated errors.
Code:
void
on_BT_EXIT_clicked	(GtkButton *button, gpointer user_data)
{
		gtk_main_quit();
}

void 
on_BT_OK_clicked (GtkButton *button, gpointer user_data) 
{ 

                GtkWidget *entry = lookup_widget (GTK_WIDGET(button), "ENTRY"); 
                GtkWidget *msgbox = gnome_app_new("Hello World", "Hello World"); 
                gchar *text1, *text2; 

                text1 = gtk_entry_get_text (GTK_ENTRY(entry)); 
                text2 = g_strconcat ("Hello, ", text1, NULL); 
                gnome_app_message (GNOME_APP(msgbox), text2);
                g_free (text2); 

}
This was the Error while linking the project.

Quote:
callbacks.c:40: Undefined reference to 'lookup_widget'
Then I deleted the on_BT_OK_clicked section. Now on_BT_EXIT_clicked only remains. I compiled and built the project. But it showed running error. the main.c file resulted in the error. It was like this
Quote:
main.c
Code:
#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include <bonobo.h>
#include <gnome.h>

#include "callbacks.h"


#include <glade/glade.h>

/* For testing propose use the local (not installed) glade file */
/* #define GLADE_FILE PACKAGE_DATA_DIR"/hw/glade/hw.glade" */
#define GLADE_FILE "hw.glade"


GtkWidget*
create_window (void)
{
	GtkWidget *window1;

	GladeXML *gxml;
	
	gxml = glade_xml_new (GLADE_FILE, NULL, NULL);
	
	/* This is important */
	glade_xml_signal_autoconnect (gxml);
	window1 = glade_xml_get_widget (gxml, "window");

	
	return window1;
}




int
main (int argc, char *argv[])
{
	GtkWidget *window1;


#ifdef ENABLE_NLS
	bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);
#endif

	gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE,
                      argc, argv,
                      GNOME_PARAM_APP_DATADIR, PACKAGE_DATA_DIR,
                      NULL);

	window1 = create_window ();
	gtk_widget_show (window1);

	gtk_main ();
	
	return 0;
}

This was the error I found on the terminal.
Quote:
Gtk-CRITICAL **: gtk_widget_show: assertion 'GTK_IS_WIDGET (widget)' failed.
I also found that Glade does not automaticall generated the 'c code' for the button cliked and etc. In previous versions I notices a header file #include <gtk/gtk.h> on the callbacks.c file. But here nothing was there. I am using Anjuta 2.4.1 with Glade 3.4.2.

I have installed libgtk2.0 and also the dev files.

Please help me cure the problem.
 
  


Reply

Tags
anjuta


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a project in Anjuta 2.0.2 with glade... TaoK Programming 1 12-01-2007 12:41 PM
Anjuta, Glade and C++ [KIA]aze Programming 1 04-16-2007 10:06 AM
Glade & Anjuta Build Problems! shawnrg Programming 1 07-02-2006 04:47 PM
glade anjuta C++ mover50 Linux - Software 0 11-11-2004 12:19 AM
Glade Tutorial rch Programming 1 05-24-2003 06:43 AM


All times are GMT -5. The time now is 11:14 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration