diff options
author | Mathias Hasselmann <mathias.hasselmann@gmx.de> | 2007-06-15 18:24:55 +0000 |
---|---|---|
committer | Mathias Hasselmann <hasselmm@src.gnome.org> | 2007-06-15 18:24:55 +0000 |
commit | 9b604e29a25ea6db2b65a8592af205467591e23f (patch) | |
tree | a2425256a3ed223b8129393c3a0579177fde72d4 /gtk/gtktooltip.c | |
parent | 4d638bf0c15c363f2c28cafc1485cf4066885383 (diff) | |
download | gtk+-9b604e29a25ea6db2b65a8592af205467591e23f.tar.gz |
Introduce convenience property "GtkWidget:tooltip-text" taking care of
2007-06-15 Mathias Hasselmann <mathias.hasselmann@gmx.de>
* docs/reference/gtk/gtk-sections.txt, gtk/gtk.symbols,
gtk/gtkwidget.c, gtk/gtkwidget.h, tests/testtooltips.c: Introduce
convenience property "GtkWidget:tooltip-text" taking care of escaping
it for unwanted markup entities. Add functions to set tooltip text:
gtk_widget_set_tooltip_text(), gtk_widget_set_tooltip_markup(),
gtk_widget_get_tooltip_text(), gtk_widget_get_tooltip_markup().
* gtk/gtktooltip.c, gtk/gtktooltip.h: Add gtk_tooltip_set_text()
to set the tooltip text without using markup.
Patches from Emmanuele Bassi (#447643).
svn path=/trunk/; revision=18142
Diffstat (limited to 'gtk/gtktooltip.c')
-rw-r--r-- | gtk/gtktooltip.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 32def54579..e32b15024f 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -215,6 +215,30 @@ gtk_tooltip_set_markup (GtkTooltip *tooltip, } /** + * gtk_tooltip_set_text: + * @tooltip: a #GtkTooltip + * @text: a text string or %NULL + * + * Sets the text of the tooltip to be @text. If @text is %NULL, the label + * will be hidden. See also gtk_tooltip_set_markup(). + * + * Since: 2.12 + */ +void +gtk_tooltip_set_text (GtkTooltip *tooltip, + const gchar *text) +{ + g_return_if_fail (GTK_IS_TOOLTIP (tooltip)); + + gtk_label_set_text (GTK_LABEL (tooltip->label), text); + + if (text) + gtk_widget_show (tooltip->label); + else + gtk_widget_hide (tooltip->label); +} + +/** * gtk_tooltip_set_icon: * @tooltip: a #GtkTooltip * @pixbuf: a #GdkPixbuf, or %NULL |