]> Pileus Git - ~andy/gtk/commitdiff
testwindows: Add a button to cause a repaint
authorAlexander Larsson <alexl@redhat.com>
Thu, 1 Dec 2011 15:21:45 +0000 (16:21 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 1 Dec 2011 21:03:51 +0000 (22:03 +0100)
This makes it easy to find various kinds of repaint bugs

tests/testwindows.c

index ecae1cf9077b33c85d888bd1927d9a388f2e5729..0535b6327bc56936c3eae089a22e4123b391368a 100644 (file)
@@ -274,6 +274,13 @@ save_children (GString *s,
 }
 
 
+static void
+refresh_clicked (GtkWidget *button, 
+                gpointer data)
+{
+  gtk_widget_queue_draw (darea);
+}
+
 static void
 save_clicked (GtkWidget *button, 
              gpointer data)
@@ -1050,6 +1057,17 @@ main (int argc, char **argv)
                    G_CALLBACK (save_clicked), 
                    NULL);
 
+  button = gtk_button_new_with_label ("Refresh");
+  gtk_box_pack_start (GTK_BOX (vbox),
+                     button,
+                     FALSE, FALSE,
+                     2);
+  gtk_widget_show (button);
+  g_signal_connect (button, "clicked", 
+                   G_CALLBACK (refresh_clicked), 
+                   NULL);
+
+  
   gtk_widget_show (window);
 
   if (argc == 2)