1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Add tips to your widgets
7 <!-- ##### SECTION Long_Description ##### -->
9 #GtkTooltip belongs to the new tooltips API that was
10 introduced in GTK+ 2.12 and which deprecates the old
14 Basic tooltips can be realized simply by using gtk_widget_set_tooltip_text()
15 or gtk_widget_set_tooltip_markup() without any explicit tooltip object.
19 When you need a tooltip with a little more fancy contents, like
20 adding an image, or you want the tooltip to have different contents
21 per GtkTreeView row or cell, you will have to do a little more work:
25 Set the #GtkWidget:has-tooltip property to %TRUE, this will
26 make GTK+ monitor the widget for motion and related events
27 which are needed to determine when and where to show a tooltip.
31 Connect to the #GtkWidget::query-tooltip signal. This signal
32 will be emitted when a tooltip is supposed to be shown. One
33 of the arguments passed to the signal handler is a #GtkTooltip
34 object. This is the object that we are about to display as a
35 tooltip, and can be manipulated in your callback using functions
36 like gtk_tooltip_set_icon(). There are functions for setting
37 the tooltip's markup, setting an image from a stock icon, or
38 even putting in a custom widget.
42 Return %TRUE from your query-tooltip handler. This causes
43 the tooltip to be show. If you return %FALSE, it will not be shown.
49 In the probably rare case where you want to have even more control
50 over the tooltip that is about to be shown, you can set your own
51 #GtkWindow which will be used as tooltip window. This works as
56 Set #GtkWidget:has-tooltip and connect to #GtkWidget::query-tooltip as
61 Use gtk_widget_set_tooltip_window() to set a #GtkWindow created
62 by you as tooltip window.
66 In the ::query-tooltip callback you can access your window
67 using gtk_widget_get_tooltip_window() and manipulate as you
68 wish. The semantics of the return value are exactly as before,
69 return %TRUE to show the window, %FALSE to not show it.
74 <!-- ##### SECTION See_Also ##### -->
79 <!-- ##### SECTION Stability_Level ##### -->
82 <!-- ##### STRUCT GtkTooltip ##### -->
88 <!-- ##### FUNCTION gtk_tooltip_set_markup ##### -->
97 <!-- ##### FUNCTION gtk_tooltip_set_text ##### -->
106 <!-- ##### FUNCTION gtk_tooltip_set_icon ##### -->
115 <!-- ##### FUNCTION gtk_tooltip_set_icon_from_stock ##### -->
125 <!-- ##### FUNCTION gtk_tooltip_set_icon_from_icon_name ##### -->
135 <!-- ##### FUNCTION gtk_tooltip_set_icon_from_gicon ##### -->
145 <!-- ##### FUNCTION gtk_tooltip_set_custom ##### -->
154 <!-- ##### FUNCTION gtk_tooltip_trigger_tooltip_query ##### -->
162 <!-- ##### FUNCTION gtk_tooltip_set_tip_area ##### -->