Back to Seed Clases

Gtk


Classes

Interfaces

Structs

Unions

Enums

GObject.Object
parent-child marker Gtk.Tooltip

Class Gtk.Tooltip

Import line: Gtk = imports.gi.Gtk;
GIR File: Gtk-3.0.gir
C documentation: GtkTooltip
Class : Tooltip
Extends: GObject.Object
Basic tooltips can be realized simply by using gtk_widget_set_tooltip_text()
or gtk_widget_set_tooltip_markup() without any explicit tooltip object.
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:



Set the GtkWidget:has-tooltip property to TRUE, this will make GTK+
monitor the widget for motion and related events which are needed to
determine when and where to show a tooltip.




Connect to the GtkWidget::query-tooltip signal. This signal will be
emitted when a tooltip is supposed to be shown. One of the arguments passed
to the signal handler is a GtkTooltip object. This is the object that we
are about to display as a tooltip, and can be manipulated in your callback
using functions like gtk_tooltip_set_icon(). There are functions for setting
the tooltip's markup, setting an image from a stock icon, or even putting in
a custom widget.




Return TRUE from your query-tooltip handler. This causes the tooltip to be
show. If you return FALSE, it will not be shown.



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:



Set GtkWidget:has-tooltip and connect to GtkWidget::query-tooltip as
before.




Use gtk_widget_set_tooltip_window() to set a GtkWindow created by you as
tooltip window.




In the GtkWidget::query-tooltip callback you can access your window using
gtk_widget_get_tooltip_window() and manipulate as you wish. The semantics of
the return value are exactly as before, return TRUE to show the window,
FALSE to not show it.


Properties
None
Methods / Constructors
Method / Constructor Defined By
 
new Gtk.Tooltip ()
Create a new Gtk.Tooltip
Create a new Gtk.Tooltip
 
Events
None
Used by These Methods / Signals / Properties
Class / Namespace Method / Signal / Properties
Gtk.IconView
Method
set_tooltip_cell (Tooltip tooltip, TreePath path, CellRenderer cell) : none
Sets the tip area of tooltip to the area which cell occupies in
the item pointed to by path.
Gtk.IconView
Method
set_tooltip_item (Tooltip tooltip, TreePath path) : none
Sets the tip area of tooltip to be the area covered by the item at path.
Gtk.StatusIcon
Signal
query_tooltip (StatusIcon self, gint32 x, gint32 y, gboolean keyboard_mode, Tooltip tooltip) : gboolean
Emitted when the GtkSettings:gtk-tooltip-timeout has expired with the
cursor hovering above status_icon; or emitted when status_icon got
focus in keyboard mode.
Gtk.TreeView
Method
set_tooltip_cell (Tooltip tooltip, TreePath path, TreeViewColumn column, CellRenderer cell) : none
Sets the tip area of tooltip to the area path, column and cell have
in common.
Gtk.TreeView
Method
set_tooltip_row (Tooltip tooltip, TreePath path) : none
Sets the tip area of tooltip to be the area covered by the row at path.
Gtk.Widget
Signal
query_tooltip (Widget self, gint32 x, gint32 y, gboolean keyboard_mode, Tooltip tooltip) : gboolean
Emitted when GtkWidget:has-tooltip is TRUE and the GtkSettings:gtk-tooltip-timeout
has expired with the cursor hovering "above" widget; or emitted when widget got
focus in keyboard mode.
GtkSource.GutterRenderer
Method
query_tooltip (TextIter iter, RectangleInt area, gint32 x, gint32 y, Tooltip tooltip) : gboolean
Documentation generated by Introspection Doc Generator Loosely Based on JsDoc Toolkit on Sat Apr 16 2011 17:14:19 GMT+0800 (HKT)