## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Tooltips

- Goto spec source

# Description

    package Gtk.Tooltips is

Tooltips are the small text windows that popup when the mouse rests over a widget, and that provide a quick help for the user.

In GtkAda, all tooltips belong to a group (a Gtk_Tooltips). All the individual tooltips in a group can be disabled or enabled at the same time. Likewise, the colors and style of a tooltip can be set on a group basis.

See the example at the end for how to change the default colors used for tooltips.

Binding from C File version 2.8.17

<testgtk>create_tooltips.adb</testgtk>

# Classes

### Gtk_Tooltips_Record

- Goto declaration in source
- Goto full declaration in source

    type Gtk_Tooltips_Record is new Glib.Object.GObject_Record with private;

#### Ancestors:

Glib.Object.GObject_Record

#### Primitive operations:

Disable

- To API doc
- To spec

Enable

- To API doc
- To spec

Force_Window

- To API doc
- To spec

Glib.Object.Deallocate

- To API doc
- To spec

(Inherited)
Glib.Object.Get_Type

- To API doc
- To spec

(Inherited)
Glib.Object.Notify

- To API doc
- To spec

(Inherited)
Glib.Object.Ref

- To API doc
- To spec

(Inherited)
Glib.Object.Ref_Sink

- To API doc
- To spec

(Inherited)
Glib.Object.Unref

- To API doc
- To spec

(Inherited)
Set_Delay

- To API doc
- To spec

Set_Icon_From_Stock

- To API doc
- To spec

Set_Markup

- To API doc
- To spec

Set_Tip

- To API doc
- To spec

# Types

### Gtk_Tooltips

- Goto declaration in source

    type Gtk_Tooltips is access all Gtk_Tooltips_Record'Class;

### Tooltips_Data

- Goto declaration in source

    type Tooltips_Data
         (Text_Length : Natural; Private_Length : Natural) is
       record
          Tooltips     : Gtk_Tooltips;    -- the group of the tooltip
          Widget       : Gtk.Widget.Gtk_Widget; -- the widget to which it applies
          Text         : UTF8_String (1 .. Text_Length); -- the text of the tooltip
          Text_Private : UTF8_String (1 .. Private_Length); -- the private text
       end record;

<doc_ignore>

# Subprograms & Entries

### Gtk_New

- Goto spec in source

    procedure Gtk_New (Widget: out Gtk_Tooltips);

Create a new group of tooltips.

### Initialize

- Goto spec in source

    procedure Initialize (Widget: access Gtk_Tooltips_Record'Class);

Internal initialization function. See the section "Creating your own widgets" in the documentation.

### Get_Type

- Goto spec in source
- Goto body in source

    function Get_Type return Glib.GType;

Return the internal value associated with a Gtk_Tooltips.

### Enable

- Goto spec in source

    procedure Enable (Tooltips: access Gtk_Tooltips_Record);

Enable all the tooltips in the group. From now on, when the mouse rests over a widget for a short period of time, the help text is automatically displayed.

### Disable

- Goto spec in source

    procedure Disable (Tooltips: access Gtk_Tooltips_Record);

Disable all the tooptips in the group. From now on, no tooltips in this group will appear, unless they are re-enabled.

### Set_Tip

- Goto spec in source

    procedure Set_Tip (Tooltips: access Gtk_Tooltips_Record;Widget: access Gtk.Widget.Gtk_Widget_Record'Class;Tip_Text: UTF8_String;Tip_Private: UTF8_String := "");

Add a new tooltip to Widget. The message that appears in the tooltip is Tip_Text, and the tooltip belongs to the group Tooltips. Tip_Private contains more information, that can be displayed by a Gtk_Tips_Query widget through the "widget_selected" signal. In most cases, Tip_Private should simply keep its default empty value.

### Get_Data

- Goto spec in source

    function Get_Data (Widget: access Gtk.Widget.Gtk_Widget_Record'Class) return Tooltips_Data;

Return the tooltip data associated with the Widget. If there is none, the two text fields in the returned structure have a length 0.

### Force_Window

- Goto spec in source

    procedure Force_Window (Widget: access Gtk_Tooltips_Record);

Make sure the window in which the tooltips will be displayed is created. This is useful if you want to modify some characteristics of that window.

### Set_Markup

- Goto spec in source

    procedure Set_Markup (Tooltips: access Gtk_Tooltips_Record;Text: UTF8_String);

Sets the text of the tooltip to be markup, which is marked up with the Pango text markup language. If markup is empty string, the label will be hidden.

### Set_Icon_From_Stock

- Goto spec in source

    procedure Set_Icon_From_Stock (Tooltips: access Gtk_Tooltips_Record;Stock_Id: String;Size: Gtk.Enums.Gtk_Icon_Size);

Sets the icon of the tooltip (which is in front of the text) to be the stock item indicated by stock_id with the size indicated by size. If stock_id is emtry string, the image will be hidden.

### Set_Delay

- Goto spec in source

    procedure Set_Delay (Tooltips: access Gtk_Tooltips_Record;Duration: Guint := 500);

Set_Delay Set the delay between the user moving the mouse over a widget and the text appearing. Duration is in milli-seconds.