Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Compile me with:
- * gcc -o tut tut.c $(pkg-config --cflags --libs gtk+-2.0 gmodule-2.0)
- */
- #include <gtk/gtk.h>
- int main(int argc, char **argv) {
- GtkBuilder *builder;
- GtkWidget *window;
- GError *error = NULL;
- /* Init GTK+ */
- gtk_init(&argc, &argv);
- /* Create new GtkBuilder object */
- builder = gtk_builder_new();
- /* Load UI from file. If error occurs, report it and quit application.*/
- if(!gtk_builder_add_from_file(builder, "dictionary.glade", &error))
- {
- g_warning("%s", error->message);
- g_free(error);
- return(1);
- }
- /* Get main window pointer from UI */
- window = GTK_WIDGET(gtk_builder_get_object( builder, "main_window"));
- /* Connect signals */
- gtk_builder_connect_signals( builder, NULL );
- /* Destroy builder, since we don't need it anymore */
- g_object_unref( G_OBJECT( builder ) );
- /* Show window. All other widgets are automatically shown by GtkBuilder */
- gtk_widget_show( window );
- /* Start main loop */
- gtk_main();
- return( 0 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement