Trying to interface Glade 3.6.7 and 'C' in Ubuntu 10.10
Hi, this is my first time here:
I've been programming GUI software in C# in MonoDev for some time now. I just noticed that I can use my favorite language, C, with Glade to do the same thing. I've been going through some tutorials with a little frustration with them. Some seem to be written for older Glade versions. The latest example had me save my Glade project to a "tutorial.glade" file. Then run it through a 'gtk-builder-convert' utility. Problem: the utility program returns errors indicating the the tutorial.glade file was written badly, that there is supposed to be a <glade-interface> tag that is missing. Any ideas??? Glade file: <?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="2.16"/> <!-- interface-naming-policy project-wide --> <object class="GtkWindow" id="window"> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_STRUCTURE_MASK</property> <property name="title" translatable="yes">GTK+ Text Editor</property> <signal name="destroy" handler="on_window_destroy"/> <child> <placeholder/> </child> </object> </interface> 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; } |
Found the problem:
The newest version of Glade, that I have, does not require using the 'gtk-builder-convert' utility. So I was confusing the issue. It works now. Hope no one spent too much time look at it. Wow, I can write GUI apps in C. Gotta love Linux. Thanks. |
All times are GMT -5. The time now is 03:36 AM. |