r405 - in trunk/src/target/OM-2007: examples/openmoko-stylus-demo/src openmoko-libs/libmokoui

mickey at gta01.hmw-consulting.de mickey at gta01.hmw-consulting.de
Wed Dec 13 18:49:19 CET 2006


Author: mickey
Date: 2006-12-13 18:49:18 +0100 (Wed, 13 Dec 2006)
New Revision: 405

Modified:
   trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c
   trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-finger-wheel.c
Log:
openmoko-stylus-demo: demo GtkEntry usage


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	2006-12-13 17:43:43 UTC (rev 404)
+++ trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c	2006-12-13 17:49:18 UTC (rev 405)
@@ -34,6 +34,7 @@
 #include <gtk/gtkmain.h>
 #include <gtk/gtkmenu.h>
 #include <gtk/gtkradiobutton.h>
+#include <gtk/gtkspinbutton.h>
 #include <gtk/gtktable.h>
 #include <gtk/gtktreeview.h>
 
@@ -141,7 +142,7 @@
 {
     g_debug( "openmoko-stylus-demo: button2 clicked" );
 
-    /* prepare contents of dialog */
+    /* prepare contents of dialog. Yes, eventually we want to use libglade for the dialogs */
 
     GtkVBox* controls = gtk_vbox_new( FALSE, 0 );
     GtkCheckButton* check1 = gtk_check_button_new_with_label( "Use GtkCheckButton for on/off options" );
@@ -181,10 +182,29 @@
     gtk_combo_box_append_text( combo, "for one setting" );
     gtk_box_pack_start_defaults( GTK_BOX(controls), GTK_WIDGET(combo) );
 
+    GtkHBox* hb1 = gtk_hbox_new( FALSE, 0 );
+    GtkLabel* l1 = gtk_label_new( "Text Entry: " );
+    gtk_misc_set_alignment( GTK_MISC(l1), 0, 0.5 );
+    gtk_misc_set_padding( GTK_MISC(l1), 8, 8 );
+    GtkEntry* e1 = gtk_entry_new();
+    g_object_set( G_OBJECT(e1), "has-frame", FALSE, NULL );
+    gtk_box_pack_start( GTK_BOX(hb1), GTK_WIDGET(l1), FALSE, FALSE, 0 );
+    gtk_box_pack_start( GTK_BOX(hb1), GTK_WIDGET(e1), TRUE, TRUE, 10 );
+    gtk_box_pack_start_defaults( GTK_BOX(controls), GTK_WIDGET(hb1) );
+
+    GtkHBox* hb2 = gtk_hbox_new( FALSE, 0 );
+    GtkLabel* l2 = gtk_label_new( "SpinBox Entry: " );
+    gtk_misc_set_alignment( GTK_MISC(l2), 0, 0.5 );
+    gtk_misc_set_padding( GTK_MISC(l2), 8, 8 );
+    GtkSpinButton* e2 = gtk_spin_button_new_with_range( -20, 20, 5 );
+    g_object_set( G_OBJECT(e2), "has-frame", FALSE, NULL );
+    gtk_box_pack_start( GTK_BOX(hb2), GTK_WIDGET(l2), FALSE, FALSE, 0 );
+    gtk_box_pack_start( GTK_BOX(hb2), GTK_WIDGET(e2), TRUE, TRUE, 10 );
+    gtk_box_pack_start_defaults( GTK_BOX(controls), GTK_WIDGET(hb2) );
+
     gtk_widget_show_all( GTK_WIDGET(controls) );
 
     /* run dialog */
-
     MokoDialogWindow* dialog = moko_application_execute_dialog( moko_application_get_instance(),
             "Example Full Screen Dialog Window",
             GTK_WIDGET(controls) );

Modified: trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-finger-wheel.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-finger-wheel.c	2006-12-13 17:43:43 UTC (rev 404)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-finger-wheel.c	2006-12-13 17:49:18 UTC (rev 405)
@@ -101,14 +101,14 @@
     object_class->dispose = moko_finger_wheel_dispose;
     object_class->finalize = moko_finger_wheel_finalize;
 
-    /** Init the moko finger wheel signal to null */
+    /* Init the moko finger wheel signal to null */
     klass->press_left_up = NULL;
     klass->press_right_down = NULL;
     klass->press_bottom = NULL;
     klass->long_press_left_up = NULL;
     klass->long_press_right_down = NULL;
 
-    /** Press the left up area */
+    /* Press the left up area */
     wheel_signals[PRESS_LEFT_UP] =
                  g_signal_new ("press_left_up",
                  G_OBJECT_CLASS_TYPE (object_class),
@@ -118,7 +118,7 @@
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
 
-    /** Press the right down area */
+    /* Press the right down area */
     wheel_signals[PRESS_RIGHT_DOWN] =
                  g_signal_new ("press_right_down",
                  G_OBJECT_CLASS_TYPE (object_class),
@@ -128,7 +128,7 @@
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
 
-    /** Press the bottom area */
+    /* Press the bottom area */
     wheel_signals[PRESS_BOTTOM] =
                  g_signal_new ("press_bottom",
                  G_OBJECT_CLASS_TYPE (object_class),
@@ -138,7 +138,7 @@
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
 
-    /** Long press the left up area */
+    /* Long press the left up area */
     wheel_signals[LONG_PRESS_LEFT_UP] =
                  g_signal_new ("long_press_left_up",
                  G_OBJECT_CLASS_TYPE (object_class),
@@ -148,7 +148,7 @@
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
 
-    /** Long press the right down area */
+    /* Long press the right down area */
     wheel_signals[LONG_PRESS_RIGHT_DOWN] =
                  g_signal_new ("long_press_right_down",
                  G_OBJECT_CLASS_TYPE (object_class),





More information about the commitlog mailing list