TooltipWidget

class visualife.widget.TooltipWidget(id_text, parent_id, tooltip_text, width, height, **kwargs)

Bases: object

Creates a new tooltip

Parameters:
  • id_text – ID of a html DIV element that will contain this TooltipWidget instance
  • parent_id – ID of the outer HTML element this tooltip should be inserted
  • tooltip_text – text that will be displayed by this tooltip (may be set later)
  • width – width of a tooltip box
  • height – width of a tooltip box
  • kwargs – see below
Keyword Arguments:
 
  • offset_x (int) – X value added to the X coordinate of the tooltip so it can be moved to the left/right in respect to the position of the hoovered element

  • offset_y (int) – Y value added to the Y coordinate of the tooltip so it can be moved to the up/down in respect to the position of the hoovered element

  • position (string) – how the tooltip will be positioned on the screen; the available values are:

    • fixed : tooltip coordinates must be given in respect to the parent element (defined by its parent_id)
    • absolute : tooltip coordinates are actual viewport (screen) coordinates
  • Class (string) – CSS class assigned to this tooltip box

  • style (string) – CSS style definition to be assigned to this tooltip; note, that this may overwrite default settings

Attributes Summary

tooltip_text Returns tooltip text
x X coordinate of tooltip div
y Y coordinate of tooltip div

Methods Summary

hide([evt]) Hides this tooltip :param evt: not used but necessary to be able to use this method as an event callback :return: None
show(x, y) Makes this tooltip visible at given position on the screen.

Attributes Documentation

tooltip_text

Returns tooltip text

x

X coordinate of tooltip div

y

Y coordinate of tooltip div

Methods Documentation

hide(evt=None)

Hides this tooltip :param evt: not used but necessary to be able to use this method as an event callback :return: None

show(x, y)

Makes this tooltip visible at given position on the screen.

Parameters:
  • x – (int) x coordinate on the screen
  • y – (int) y coordinate on the screen
Returns:

None