org.gnome.gtk

## Class Tooltip

- Object
- - org.freedesktop.bindings.Pointer
  - - org.freedesktop.bindings.Proxy
    - - org.gnome.glib.Object
      - - org.gnome.gtk.Tooltip

-     public class Tooltip
      extends Object

  Displaying a tooltip when a user hovers the mouse over the widget or when the widget receives notification the cursor is at it when in keyboard mode.

  By default you can set text to show as a tooltip by using `Widget.setTooltipText(java.lang.String)` and `Widget.setTooltipMarkup(java.lang.String)` . However that is for basic text and only text. If you want more then that you can hookup your own tooltip query handler which in turn will provide an object of this class for you to use.

  In order to get an object of this class you first have to connect a queryTooltip Handler.

       // any widget will do
       widget = new Button();
       widget.connect(new Widget.queryTooltip() {
           @Override
           public boolean onQueryTooltip(Widget source, int x, int y, boolean keyboardMode, Tooltip tooltip) {
               // setup your tooltip.
           }
       });

  Inside the method you can create your tooltip. You also receive the X and Y values at which you can determine whether to show the tooltip or not. Which is needed for example a TreeView which has a method to help you with. See `TreeView.hasTooltipContext(int, int, boolean)` for more information on how a TreeView handles tooltips.

  KeyboardMode indicates that the application is run by only the keyboard and no mouse.

  When you want to show your tooltip return true, otherwise false.

  There are two modes of displaying your tooltip contents. The first is the basic Icon and String. You can set this up in anyway you want. Please do note that both are on the same line and that the icon will always be on the left.

  If you want something more fancy or display more information you set any widget to show. Suggested is a container of course. Where you have full freedom to place all your tooltip contents.

  Since:
    4.1.3
  Author:
    Sarah Leibbrand

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `setCustomWidget(Widget widget)` The widget to display in the tooltip.
    `void` | `setIcon(Pixbuf icon)` The icon to display in your tooltip.
    `void` | `setMarkup(String markup)` The text in pango markup to display in the tooltip.
    `void` | `setStockIcon(Stock stock, IconSize size)` The stock icon with the requested size to display in the tooltip.
    `void` | `setText(String text)` The text to display in the tooltip.

    - ### Methods inherited from class org.freedesktop.bindings.Pointer

      `toString`

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### setCustomWidget

          public void setCustomWidget(Widget widget)

      The widget to display in the tooltip. This can be any widget but containers such as `Grid` are recommended.
      Since:
        4.1.3

    - #### setIcon

          public void setIcon(Pixbuf icon)

      The icon to display in your tooltip.
      Since:
        4.1.3

    - #### setMarkup

          public void setMarkup(String markup)

      The text in pango markup to display in the tooltip.
      Since:
        4.1.3

    - #### setStockIcon

          public void setStockIcon(Stock stock,
                          IconSize size)

      The stock icon with the requested size to display in the tooltip.
      Since:
        4.1.3

    - #### setText

          public void setText(String text)

      The text to display in the tooltip.
      Since:
        4.1.3