Commit ffcc8ddb authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Add code to test gtk_tooltip_set_custom()

2007-07-23  Matthias Clasen  <mclasen@redhat.com>

        * tests/testtooltips.c: Add code to test gtk_tooltip_set_custom()



svn path=/trunk/; revision=18533
parent d4053163
2007-07-23 Matthias Clasen <mclasen@redhat.com>
* tests/testtooltips.c: Add code to test gtk_tooltip_set_custom()
2007-07-23 Christian Persch <chpe@gnome.org>
* tests/testtooltips.c: (query_tooltip_tree_view_cb): Remove obsolete
......
......@@ -239,6 +239,21 @@ drawing_area_expose (GtkWidget *drawing_area,
return FALSE;
}
static gboolean
query_tooltip_label_cb (GtkWidget *widget,
gint x,
gint y,
gboolean keyboard_tip,
GtkTooltip *tooltip,
gpointer data)
{
GtkWidget *custom = data;
gtk_tooltip_set_custom (tooltip, custom);
return TRUE;
}
int
main (int argc, char *argv[])
{
......@@ -246,6 +261,7 @@ main (int argc, char *argv[])
GtkWidget *box;
GtkWidget *drawing_area;
GtkWidget *button;
GtkWidget *label;
GtkWidget *tooltip_window;
GtkWidget *tooltip_button;
......@@ -390,6 +406,22 @@ main (int argc, char *argv[])
G_CALLBACK (query_tooltip_drawing_area_cb), NULL);
gtk_box_pack_start (GTK_BOX (box), drawing_area, FALSE, FALSE, 2);
button = gtk_label_new ("Custom tooltip I");
label = gtk_label_new ("See, custom");
g_object_ref_sink (label);
g_object_set (button, "has-tooltip", TRUE, NULL);
g_signal_connect (button, "query-tooltip",
G_CALLBACK (query_tooltip_label_cb), label);
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 2);
button = gtk_label_new ("Custom tooltip II");
label = gtk_label_new ("See, custom, too");
g_object_ref_sink (label);
g_object_set (button, "has-tooltip", TRUE, NULL);
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 2);
g_signal_connect (button, "query-tooltip",
G_CALLBACK (query_tooltip_label_cb), label);
/* Done! */
gtk_widget_show_all (window);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment