Add an animation mode, to test how the combobox behaves if the model
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.
This commit is contained in:
parent
2140cee8c8
commit
2169f50919
@ -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 ===
|
||||
|
@ -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 ===
|
||||
|
@ -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 ===
|
||||
|
@ -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 ===
|
||||
|
@ -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 ===
|
||||
|
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user