Interface Widget.OnQueryTooltip

Enclosing class:
Widget
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface Widget.OnQueryTooltip
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    onQueryTooltip(int x, int y, boolean keyboard_mode, Tooltip tooltip)
    Emitted when the widgets tooltip is about to be shown.
  • Method Details

    • onQueryTooltip

      boolean onQueryTooltip(int x, int y, boolean keyboard_mode, @Nonnull Tooltip tooltip)
      Emitted when the widgets tooltip is about to be shown.

      This happens when the [property@Gtk.Widget:has-tooltip] property
      is %TRUE and the hover timeout has expired with the cursor hovering
      "above" @widget; or emitted when @widget got focus in keyboard mode.

      Using the given coordinates, the signal handler should determine
      whether a tooltip should be shown for @widget. If this is the case
      %TRUE should be returned, %FALSE otherwise. Note that if
      @keyboard_mode is %TRUE, the values of @x and @y are undefined and
      should not be used.

      The signal handler is free to manipulate @tooltip with the therefore
      destined function calls.
      Parameters:
      x - the x coordinate of the cursor position where the request has been emitted, relative to @widget's left side
      y - the y coordinate of the cursor position where the request has been emitted, relative to @widget's top
      keyboard_mode - %TRUE if the tooltip was triggered using the keyboard
      tooltip - a `GtkTooltip`
      Returns:
      %TRUE if @tooltip should be shown right now, %FALSE otherwise.