summaryrefslogtreecommitdiff
path: root/tests/testtooltips.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testtooltips.c')
-rw-r--r--tests/testtooltips.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/testtooltips.c b/tests/testtooltips.c
index 0f9af5ce05..3ae905ed9c 100644
--- a/tests/testtooltips.c
+++ b/tests/testtooltips.c
@@ -260,6 +260,17 @@ query_tooltip_label_cb (GtkWidget *widget,
return TRUE;
}
+static void
+quit_cb (GtkWidget *widget,
+ gpointer data)
+{
+ gboolean *done = data;
+
+ *done = TRUE;
+
+ g_main_context_wakeup (NULL);
+}
+
int
main (int argc, char *argv[])
{
@@ -281,12 +292,13 @@ main (int argc, char *argv[])
GtkTextTag *tag;
gchar *text, *markup;
+ gboolean done = FALSE;
gtk_init ();
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Tooltips test");
- g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
+ g_signal_connect (window, "destroy", G_CALLBACK (quit_cb), &done);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_container_add (GTK_CONTAINER (window), box);
@@ -436,7 +448,8 @@ main (int argc, char *argv[])
/* Done! */
gtk_widget_show (window);
- gtk_main ();
+ while (!done)
+ g_main_context_iteration (NULL, TRUE);
return 0;
}