summaryrefslogtreecommitdiff
path: root/tests/testtooltips.c
diff options
context:
space:
mode:
authorMathias Hasselmann <mathias.hasselmann@gmx.de>2007-06-15 18:25:11 +0000
committerMathias Hasselmann <hasselmm@src.gnome.org>2007-06-15 18:25:11 +0000
commitced0bab02f7593ec5b84e40dfc181f363f3e294a (patch)
treef761a596ed4b50988c84dba6dd8b3eb0ac1d6506 /tests/testtooltips.c
parent9b604e29a25ea6db2b65a8592af205467591e23f (diff)
downloadgtk+-ced0bab02f7593ec5b84e40dfc181f363f3e294a.tar.gz
Improving handling of tooltip-text property. Also check result of tooltip
2007-06-15 Mathias Hasselmann <mathias.hasselmann@gmx.de> * gtk/gtkwidget.c: Improving handling of tooltip-text property. * tests/testtooltips.c: Also check result of tooltip getters. svn path=/trunk/; revision=18143
Diffstat (limited to 'tests/testtooltips.c')
-rw-r--r--tests/testtooltips.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/testtooltips.c b/tests/testtooltips.c
index 3a94c4438b..358cb90654 100644
--- a/tests/testtooltips.c
+++ b/tests/testtooltips.c
@@ -273,6 +273,8 @@ main (int argc, char *argv[])
GtkTextIter iter;
GtkTextTag *tag;
+ gchar *text, *markup;
+
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -289,6 +291,12 @@ main (int argc, char *argv[])
gtk_widget_set_tooltip_text (button, "Hello, I am a static tooltip.");
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
+ text = gtk_widget_get_tooltip_text (button);
+ markup = gtk_widget_get_tooltip_markup (button);
+ g_assert (g_str_equal ("Hello, I am a static tooltip.", text));
+ g_assert (g_str_equal ("Hello, I am a static tooltip.", markup));
+ g_free (text); g_free (markup);
+
/* A check button using the query-tooltip signal */
button = gtk_check_button_new_with_label ("I use the query-tooltip signal");
g_object_set (button, "has-tooltip", TRUE, NULL);
@@ -302,12 +310,24 @@ main (int argc, char *argv[])
gtk_widget_set_tooltip_text (button, "Label & and tooltip");
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
+ text = gtk_widget_get_tooltip_text (button);
+ markup = gtk_widget_get_tooltip_markup (button);
+ g_assert (g_str_equal ("Label & and tooltip", text));
+ g_assert (g_str_equal ("Label &amp; and tooltip", markup));
+ g_free (text); g_free (markup);
+
/* A selectable label */
button = gtk_label_new ("I am a selectable label");
gtk_label_set_selectable (GTK_LABEL (button), TRUE);
gtk_widget_set_tooltip_markup (button, "<b>Another</b> Label tooltip");
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
+ text = gtk_widget_get_tooltip_text (button);
+ markup = gtk_widget_get_tooltip_markup (button);
+ g_assert (g_str_equal ("Another Label tooltip", text));
+ g_assert (g_str_equal ("<b>Another</b> Label tooltip", markup));
+ g_free (text); g_free (markup);
+
/* Another one, with a custom tooltip window */
button = gtk_check_button_new_with_label ("This one has a custom tooltip window!");
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);