display_glade/showme shows the widgets of a glade file specified on the command line
authorSilvan Marco Fin <silvan@kernelconcepts.de>
Tue, 9 May 2006 12:48:19 +0000 (12:48 +0000)
committerSilvan Marco Fin <silvan@kernelconcepts.de>
Tue, 9 May 2006 12:48:19 +0000 (12:48 +0000)
or all widgets (if visible)

pmo-trunk-r14

experimental/display_glade/Makefile [new file with mode: 0644]
experimental/display_glade/showme.c [new file with mode: 0644]

diff --git a/experimental/display_glade/Makefile b/experimental/display_glade/Makefile
new file mode 100644 (file)
index 0000000..7d73e18
--- /dev/null
@@ -0,0 +1,24 @@
+# Mind -Wl,-export-dynamic in case, a signal handler is defined in the main file!
+export CFLAGS=`pkg-config --cflags libglade-2.0`
+export LDFLAGS=`pkg-config --libs libglade-2.0` -export-dynamic
+
+TARGET=showme
+
+MEMBERS=${TARGET}
+
+DEPS = $(patsubst %,%.d,$(MEMBERS))
+OBJECTS = $(patsubst %,%.o,$(MEMBERS))
+
+all: ${TARGET}
+
+
+${TARGET}: ${OBJECTS}
+       ${CC} -o ${TARGET} ${OBJECTS} ${CFLAGS} ${LDFLAGS}
+
+clean:
+       rm ${OBJECTS} ${TARGET}
+
+-include ${DEPS}
+
+
+
diff --git a/experimental/display_glade/showme.c b/experimental/display_glade/showme.c
new file mode 100644 (file)
index 0000000..240eb14
--- /dev/null
@@ -0,0 +1,30 @@
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+/*
+ * #include "mysignals.h"
+ */
+
+int main (int argc,
+          char *argv[])
+{
+    GladeXML *xml;
+    GtkWidget *widget;
+
+    gtk_init(&argc,
+             &argv);
+    glade_init();
+
+    if (argc<2)
+        return 0;
+
+    /* load the interface */
+    xml=glade_xml_new(argv[1], argc > 2 ? argv[2] : NULL, NULL);
+
+    /* connect signal handlers */
+    glade_xml_signal_autoconnect(xml);
+
+    gtk_main();
+
+    return 0;
+}
+