summaryrefslogtreecommitdiff
path: root/tests/testtooltips.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-10-12 05:21:01 +0200
committerBenjamin Otte <otte@redhat.com>2014-10-12 05:21:01 +0200
commitc96945b3909f64c24aac6192fc3b27e4ee10d06b (patch)
treeb9b4b706e52fc8c087bb767bd937027ba2e3cd29 /tests/testtooltips.c
parent3d45d53714f48fe0af62157fffcbdcf6eb745194 (diff)
downloadgtk+-c96945b3909f64c24aac6192fc3b27e4ee10d06b.tar.gz
tests: Update testtooltips for deprecations
Diffstat (limited to 'tests/testtooltips.c')
-rw-r--r--tests/testtooltips.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/testtooltips.c b/tests/testtooltips.c
index b8d1e13469..4e1552d69b 100644
--- a/tests/testtooltips.c
+++ b/tests/testtooltips.c
@@ -39,6 +39,17 @@ query_tooltip_cb (GtkWidget *widget,
}
static gboolean
+draw_tooltip (GtkWidget *widget,
+ cairo_t *cr,
+ gpointer unused)
+{
+ cairo_set_source_rgb (cr, 0, 0, 1);
+ cairo_paint (cr);
+
+ return FALSE;
+}
+
+static gboolean
query_tooltip_custom_cb (GtkWidget *widget,
gint x,
gint y,
@@ -46,10 +57,10 @@ query_tooltip_custom_cb (GtkWidget *widget,
GtkTooltip *tooltip,
gpointer data)
{
- GdkRGBA color = { 0, 0, 1, 1 };
GtkWindow *window = gtk_widget_get_tooltip_window (widget);
- gtk_widget_override_background_color (GTK_WIDGET (window), 0, &color);
+ gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
+ g_signal_connect (window, "draw", G_CALLBACK (draw_tooltip), NULL);
return TRUE;
}