File: test.c

package info (click to toggle)
eazel-engine 0.3-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,236 kB
  • ctags: 404
  • sloc: sh: 9,807; ansic: 4,342; makefile: 250; perl: 76
file content (33 lines) | stat: -rw-r--r-- 800 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

#include <gtk/gtk.h>
#include <glade/glade.h>
#include <gnome.h>
#include <unistd.h>
#include <stdlib.h>

int
main (int argc, char **argv)
{
    GladeXML *xml;
    GtkWidget *window;

    setenv ("GTK_RC_FILES", DATADIR "/themes/Crux/gtk/gtkrc", 0);
    setenv ("GNOME_DISABLE_CRASH_DIALOG", "1", 0);

    gnome_init ("foo", "0", argc, argv);
    glade_gnome_init ();

    if (access ("./test.glade", R_OK) == 0)
	xml = glade_xml_new ("./test.glade", "window1");
    else if (access ("../test.glade", R_OK) == 0)
	xml = glade_xml_new ("../test.glade", "window1");
    else
	g_error ("can't load test.glade");

    window = glade_xml_get_widget (xml, "window1");
    glade_xml_signal_autoconnect (xml);
    gtk_object_destroy (GTK_OBJECT (xml));
    gtk_widget_show_all (window);

    gtk_main ();
}