r514 - trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src

mickey at gta01.hmw-consulting.de mickey at gta01.hmw-consulting.de
Mon Jan 8 08:34:50 CET 2007


Author: mickey
Date: 2007-01-08 08:34:50 +0100 (Mon, 08 Jan 2007)
New Revision: 514

Modified:
   trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c
Log:
openmoko-stylus-demo: demo gtk confirmation dialogs. may want to produce MokoConfirmationDialogs eventually


Modified: trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c
===================================================================
--- trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c	2007-01-08 03:13:11 UTC (rev 513)
+++ trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c	2007-01-08 07:34:50 UTC (rev 514)
@@ -33,6 +33,7 @@
 #include <gtk/gtklabel.h>
 #include <gtk/gtkmain.h>
 #include <gtk/gtkmenu.h>
+#include <gtk/gtkmessagedialog.h>
 #include <gtk/gtkradiobutton.h>
 #include <gtk/gtkspinbutton.h>
 #include <gtk/gtktable.h>
@@ -136,6 +137,14 @@
 void cb_button1_clicked(GtkButton *button, gpointer user_data)
 {
     g_debug( "openmoko-stylus-demo: button1 clicked" );
+
+    GtkMessageDialog* dialog = gtk_message_dialog_new( moko_application_get_main_window( moko_application_get_instance() ),
+                                  GTK_DIALOG_DESTROY_WITH_PARENT,
+                                  GTK_MESSAGE_ERROR,
+                                  GTK_BUTTONS_YES_NO,
+                                  "Simple question dialog" );
+    gtk_dialog_run (GTK_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
 }
 
 void cb_button2_clicked(GtkButton *button, gpointer user_data)
@@ -221,6 +230,14 @@
 void cb_button4_clicked(GtkButton *button, gpointer user_data)
 {
     g_debug( "openmoko-stylus-demo: button4 clicked" );
+
+    GtkMessageDialog* dialog = gtk_message_dialog_new( moko_application_get_main_window( moko_application_get_instance() ),
+                                  GTK_DIALOG_DESTROY_WITH_PARENT,
+                                  GTK_MESSAGE_QUESTION,
+                                  GTK_BUTTONS_CLOSE,
+                                  "Simple confirmation dialog" );
+    gtk_dialog_run (GTK_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
 }
 
 static gboolean searchmode = TRUE;





More information about the commitlog mailing list