type Gtk_Tooltip_Record is new GObject_Record with null record;
type Gtk_Tooltip is access all Gtk_Tooltip_Record'Class;
function Get_Type return Glib.GType;
procedure Set_Custom
( | Self | : not null access Gtk_Tooltip_Record; |
Custom_Widget | : access Gtk.Widget.Gtk_Widget_Record'Class); |
procedure Set_Icon
( | Self | : not null access Gtk_Tooltip_Record; |
Pixbuf | : access Gdk.Pixbuf.Gdk_Pixbuf_Record'Class); |
procedure Set_Icon_From_Gicon
( | Self | : not null access Gtk_Tooltip_Record; |
G_Icon | : Glib.G_Icon.G_Icon; | |
Size | : Gtk.Enums.Gtk_Icon_Size); |
procedure Set_Icon_From_Icon_Name
( | Self | : not null access Gtk_Tooltip_Record; |
Icon_Name | : UTF8_String := ""; | |
Size | : Gtk.Enums.Gtk_Icon_Size); |
procedure Set_Icon_From_Stock
( | Self | : not null access Gtk_Tooltip_Record; |
Stock_Id | : UTF8_String := ""; | |
Size | : Gtk.Enums.Gtk_Icon_Size); |
procedure Set_Markup
( | Self | : not null access Gtk_Tooltip_Record; |
Markup | : UTF8_String := ""); |
procedure Set_Text
( | Self | : not null access Gtk_Tooltip_Record; |
Text | : UTF8_String := ""); |
procedure Set_Tip_Area
( | Self | : not null access Gtk_Tooltip_Record; |
Rect | : Gdk.Rectangle.Gdk_Rectangle); |
procedure Trigger_Tooltip_Query
( | Display | : not null access Gdk.Display.Gdk_Display_Record'Class); |
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 Gtk.Tree_View.Gtk_Tree_View row or cell, you will have to do a little more work: * Set the Gtk.Widget.Gtk_Widget: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 Gtk.Widget.Gtk_Widget::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 Gtk.Window.Gtk_Window which will be used as tooltip window. This works as follows: * Set Gtk.Widget.Gtk_Widget:has-tooltip and connect to Gtk.Widget.Gtk_Widget::query-tooltip as before. * Use Gtk.Widget.Set_Tooltip_Window to set a Gtk.Window.Gtk_Window created by you as tooltip window. * In the Gtk.Widget.Gtk_Widget::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.