Synopsis#include <gtk/gtk.h> GtkTooltip; void gtk_tooltip_set_markup (GtkTooltip *tooltip, const gchar *markup); void gtk_tooltip_set_text (GtkTooltip *tooltip, const gchar *text); void gtk_tooltip_set_icon (GtkTooltip *tooltip, GdkPixbuf *pixbuf); void gtk_tooltip_set_icon_from_stock (GtkTooltip *tooltip, const gchar *stock_id, GtkIconSize size); void gtk_tooltip_set_icon_from_icon_name (GtkTooltip *tooltip, const gchar *icon_name, GtkIconSize size); void gtk_tooltip_set_custom (GtkTooltip *tooltip, GtkWidget *custom_widget); void gtk_tooltip_trigger_tooltip_query (GdkDisplay *display); void gtk_tooltip_set_tip_area (GtkTooltip *tooltip, const GdkRectangle *rect); DescriptionGtkTooltip belongs to the new tooltips API that was introduced in GTK+ 2.12 and which deprecates the old GtkTooltips API.
Basic tooltips can be realized simply by using When you need a tooltip with a little more fancy contents, like adding an image, or you want the tooltip to have different contents per GtkTreeView row or cell, you will have to do a little more work:
In the probably rare case where you want to have even more control over the tooltip that is about to be shown, you can set your own GtkWindow which will be used as tooltip window. This works as follows:
Detailsgtk_tooltip_set_markup ()void gtk_tooltip_set_markup (GtkTooltip *tooltip, const gchar *markup);
Sets the text of the tooltip to be
Since 2.12 gtk_tooltip_set_text ()void gtk_tooltip_set_text (GtkTooltip *tooltip, const gchar *text);
Sets the text of the tooltip to be
Since 2.12 gtk_tooltip_set_icon ()void gtk_tooltip_set_icon (GtkTooltip *tooltip, GdkPixbuf *pixbuf);
Sets the icon of the tooltip (which is in front of the text) to be
Since 2.12 gtk_tooltip_set_icon_from_stock ()void gtk_tooltip_set_icon_from_stock (GtkTooltip *tooltip, const gchar *stock_id, GtkIconSize size);
Sets the icon of the tooltip (which is in front of the text) to be
the stock item indicated by
Since 2.12 gtk_tooltip_set_icon_from_icon_name ()void gtk_tooltip_set_icon_from_icon_name (GtkTooltip *tooltip, const gchar *icon_name, GtkIconSize size);
Sets the icon of the tooltip (which is in front of the text) to be
the icon indicated by
Since 2.14 gtk_tooltip_set_custom ()void gtk_tooltip_set_custom (GtkTooltip *tooltip, GtkWidget *custom_widget);
Replaces the widget packed into the tooltip with
Since 2.12 gtk_tooltip_trigger_tooltip_query ()void gtk_tooltip_trigger_tooltip_query (GdkDisplay *display);
Triggers a new tooltip query on
Since 2.12 gtk_tooltip_set_tip_area ()void gtk_tooltip_set_tip_area (GtkTooltip *tooltip, const GdkRectangle *rect);
Sets the area of the widget, where the contents of this tooltip apply,
to be
For setting tooltips on GtkTreeView, please refer to the convenience
functions for this:
Since 2.12 |