[gtk+/touchscreens: 18/69] tests: Add an entry to testpressandhold



commit e48285f75998bcbad960acc118b935aa9b9cfa00
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Nov 1 03:03:40 2011 +0100

    tests: Add an entry to testpressandhold
    
    Useful for checking behavior while selecting,
    starting drags, subwindows...

 tests/testpressandhold.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/tests/testpressandhold.c b/tests/testpressandhold.c
index 0f0f287..e4fe8c4 100644
--- a/tests/testpressandhold.c
+++ b/tests/testpressandhold.c
@@ -142,7 +142,7 @@ main (int argc, char **argv)
 {
   GtkWidget *window;
   GtkWidget *box;
-  GtkWidget *label, *checkbutton, *tree_view;
+  GtkWidget *label, *checkbutton, *tree_view, *entry;
 
   gtk_init (&argc, &argv);
 
@@ -152,10 +152,9 @@ main (int argc, char **argv)
   g_signal_connect (window, "delete_event",
 		    G_CALLBACK (gtk_main_quit), NULL);
 
-  box = gtk_vbox_new (FALSE, 3);
+  box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
   gtk_container_add (GTK_CONTAINER (window), box);
 
-
   label = gtk_button_new_with_label ("Press-n-hold me!");
   g_signal_connect (label, "press-and-hold",
 		    G_CALLBACK (press_and_hold), NULL);
@@ -184,6 +183,12 @@ main (int argc, char **argv)
 
   gtk_box_pack_start (GTK_BOX (box), tree_view, FALSE, FALSE, 0);
 
+  entry = gtk_entry_new ();
+  gtk_entry_set_text (GTK_ENTRY (entry), "Press and hold me");
+  g_signal_connect (entry, "press-and-hold",
+                    G_CALLBACK (press_and_hold), NULL);
+  gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 0);
+
   gtk_widget_show_all (window);
 
   gtk_main ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]