]> Pileus Git - ~andy/gtk/commitdiff
Add an animation mode, to test how the combobox behaves if the model
authorMatthias Clasen <maclas@gmx.de>
Tue, 2 Mar 2004 23:29:21 +0000 (23:29 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 2 Mar 2004 23:29:21 +0000 (23:29 +0000)
Wed Mar  3 00:28:59 2004  Matthias Clasen  <maclas@gmx.de>

* tests/testcombochange.c: Add an animation mode, to test
how the combobox behaves if the model changes while it is popped
up.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
tests/testcombochange.c

index 2b2577a924b8315fe16dfd694a4d5af18277ba00..bfc8abfa0ce3667a1aff7e38b7f622878312c297 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Mar  3 00:28:59 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * tests/testcombochange.c: Add an animation mode, to test 
+       how the combobox behaves if the model changes while it is popped
+       up.
+
 Tue Mar  2 17:06:05 2004  Owen Taylor  <otaylor@redhat.com>
 
        * === Released 2.3.5 ===
index 2b2577a924b8315fe16dfd694a4d5af18277ba00..bfc8abfa0ce3667a1aff7e38b7f622878312c297 100644 (file)
@@ -1,3 +1,9 @@
+Wed Mar  3 00:28:59 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * tests/testcombochange.c: Add an animation mode, to test 
+       how the combobox behaves if the model changes while it is popped
+       up.
+
 Tue Mar  2 17:06:05 2004  Owen Taylor  <otaylor@redhat.com>
 
        * === Released 2.3.5 ===
index 2b2577a924b8315fe16dfd694a4d5af18277ba00..bfc8abfa0ce3667a1aff7e38b7f622878312c297 100644 (file)
@@ -1,3 +1,9 @@
+Wed Mar  3 00:28:59 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * tests/testcombochange.c: Add an animation mode, to test 
+       how the combobox behaves if the model changes while it is popped
+       up.
+
 Tue Mar  2 17:06:05 2004  Owen Taylor  <otaylor@redhat.com>
 
        * === Released 2.3.5 ===
index 2b2577a924b8315fe16dfd694a4d5af18277ba00..bfc8abfa0ce3667a1aff7e38b7f622878312c297 100644 (file)
@@ -1,3 +1,9 @@
+Wed Mar  3 00:28:59 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * tests/testcombochange.c: Add an animation mode, to test 
+       how the combobox behaves if the model changes while it is popped
+       up.
+
 Tue Mar  2 17:06:05 2004  Owen Taylor  <otaylor@redhat.com>
 
        * === Released 2.3.5 ===
index 2b2577a924b8315fe16dfd694a4d5af18277ba00..bfc8abfa0ce3667a1aff7e38b7f622878312c297 100644 (file)
@@ -1,3 +1,9 @@
+Wed Mar  3 00:28:59 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * tests/testcombochange.c: Add an animation mode, to test 
+       how the combobox behaves if the model changes while it is popped
+       up.
+
 Tue Mar  2 17:06:05 2004  Owen Taylor  <otaylor@redhat.com>
 
        * === Released 2.3.5 ===
index 97224b3729e042eaf1fc30a9a3fd3d10083053b6..965460f5516599ee541053bd7a2f0625b381d829 100644 (file)
@@ -155,11 +155,11 @@ on_reorder (void)
   for (i = 0; i < contents->len; i++)
     shuffle_array[i] = i;
 
-  for (i = 0; i < contents->len - 1; i++)
+  for (i = 0; i + 1 < contents->len; i++)
     {
       gint pos = g_random_int_range (i, contents->len);
       gint tmp;
-      
+
       tmp = shuffle_array[i];
       shuffle_array[i] = shuffle_array[pos];
       shuffle_array[pos] = tmp;
@@ -179,6 +179,37 @@ on_reorder (void)
   g_free (shuffle_array);
 }
 
+static int n_animations = 0;
+static int timer = 0;
+
+static gint
+animation_timer (gpointer data)
+{
+  switch (g_random_int_range (0, 3)) 
+    {
+    case 0: 
+      on_insert ();
+      break;
+    case 1:
+      on_delete ();
+      break;
+    case 2:
+      on_reorder ();
+      break;
+    }
+
+  n_animations--;
+  return n_animations > 0;
+}
+
+static void
+on_animate (void)
+{
+  n_animations += 20;
+  timer = g_timeout_add (1000, (GSourceFunc) animation_timer, NULL);
+}
+
 int
 main (int argc, char **argv)
 {
@@ -262,6 +293,10 @@ main (int argc, char **argv)
   gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE, 0);
   g_signal_connect (button, "clicked", G_CALLBACK (on_reorder), NULL);
 
+  button = align_button_new ("Animate");
+  gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE, 0);
+  g_signal_connect (button, "clicked", G_CALLBACK (on_animate), NULL);
+
   gtk_widget_show_all (dialog);
   gtk_dialog_run (GTK_DIALOG (dialog));