r1554 - in trunk/src/target/OM-2007/examples: . openmoko-dialog-demo

thomas at sita.openmoko.org thomas at sita.openmoko.org
Thu Mar 29 21:45:02 CEST 2007


Author: thomas
Date: 2007-03-29 21:45:01 +0200 (Thu, 29 Mar 2007)
New Revision: 1554

Added:
   trunk/src/target/OM-2007/examples/openmoko-dialog-demo/
   trunk/src/target/OM-2007/examples/openmoko-dialog-demo/Makefile
   trunk/src/target/OM-2007/examples/openmoko-dialog-demo/moko-dialog-test.c
Log:
* Add an example program to test MokoDialog


Added: trunk/src/target/OM-2007/examples/openmoko-dialog-demo/Makefile
===================================================================
--- trunk/src/target/OM-2007/examples/openmoko-dialog-demo/Makefile	2007-03-29 17:16:50 UTC (rev 1553)
+++ trunk/src/target/OM-2007/examples/openmoko-dialog-demo/Makefile	2007-03-29 19:45:01 UTC (rev 1554)
@@ -0,0 +1,3 @@
+all:
+	gcc moko-dialog-test.c -o moko-dialog-test -g \
+	`pkg-config --libs --cflags openmoko-libs gtk+-2.0`

Added: trunk/src/target/OM-2007/examples/openmoko-dialog-demo/moko-dialog-test.c
===================================================================
--- trunk/src/target/OM-2007/examples/openmoko-dialog-demo/moko-dialog-test.c	2007-03-29 17:16:50 UTC (rev 1553)
+++ trunk/src/target/OM-2007/examples/openmoko-dialog-demo/moko-dialog-test.c	2007-03-29 19:45:01 UTC (rev 1554)
@@ -0,0 +1,28 @@
+#include <libmokoui/moko-dialog.h>
+
+
+int
+main (int argc, char *argv[])
+{
+  GtkWidget *d, *b1, *b2, *b3;
+  GtkSettings *s;
+
+  gtk_init (&argc, &argv);
+
+  s = gtk_settings_get_default ();
+  g_object_set (G_OBJECT(s), "gtk-theme-name", "openmoko-standard", NULL);
+
+  d = moko_dialog_new ();
+
+  moko_dialog_add_buttons (d, "Open", 0, NULL);
+
+  b1 = moko_dialog_add_button (d, GTK_STOCK_GO_BACK, 0);
+  b2 = moko_dialog_add_button (d, GTK_STOCK_GO_FORWARD, 0);
+
+  gtk_button_box_set_child_secondary (MOKO_DIALOG (d)->action_area, b1, TRUE);
+  gtk_button_box_set_child_secondary (MOKO_DIALOG (d)->action_area, b2, TRUE);
+
+  moko_dialog_run (d);
+
+
+}





More information about the commitlog mailing list