Skip to content

Instantly share code, notes, and snippets.

@bert
Created December 19, 2009 17:11
Show Gist options
  • Save bert/260149 to your computer and use it in GitHub Desktop.
Save bert/260149 to your computer and use it in GitHub Desktop.
Glade_new in gtk-win32 example
/*!
* \file gtk_and_glade_test.c
* \brief
*
* How to use glade_new in gtk-win32
* You have to link with the libraries you use, particularly -lglade-2.0 here.
* But since you use gcc, I suppose pkg-config would work for you,
* and therefore stop guessing what to put on the gcc command line and use
* pkg-config.
*/
#include <gtk/gtk.h>
#include <glade/glade.h>
int
main (int argc, char *argv[])
{
GladeXML* xml;
GtkWidget *main_window;
gtk_init (&argc, &argv);
glade_init ();
xml = glade_xml_new ("C:\\glade.glade", NULL, NULL);
glade_xml_signal_autoconnect (xml);
main_window = glade_xml_get_widget (xml, "main_window");
gtk_widget_show (main_window);
gtk_main ();
return 0;
}
/* EOF */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment