From: Silvan Marco Fin Date: Tue, 9 May 2006 12:48:19 +0000 (+0000) Subject: display_glade/showme shows the widgets of a glade file specified on the command line X-Git-Tag: git_migration_finished~4831 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=3d5d5a9d5c6e0cd1590faf5e077a5043acbc558e;p=modest display_glade/showme shows the widgets of a glade file specified on the command line or all widgets (if visible) pmo-trunk-r14 --- diff --git a/experimental/display_glade/Makefile b/experimental/display_glade/Makefile new file mode 100644 index 0000000..7d73e18 --- /dev/null +++ b/experimental/display_glade/Makefile @@ -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 index 0000000..240eb14 --- /dev/null +++ b/experimental/display_glade/showme.c @@ -0,0 +1,30 @@ +#include +#include +/* + * #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; +} +