Skip to main content

Python Tkinter Tooltip

This is a simple and basic python class aimed to show a tooltip when hovering a tkinter widget.

How to use it

To use the tooltip class in your project just follow these simple steps:

  1. install it with pip install python-tkinter-tooltip
  2. import it in your python file with from tkinter_tooltip import Tooltip
  3. create an instance of the tooltip class
  4. set the tooltip

Insert this line of code to create a tooltip object

my_tooltip = Tooltip(root)

When creating a new tooltip object only one parameter is required, the target widget (usually root window) There are few parameters that can be optionally configured.

delay=3000,             # milliseconds to wait before showing the tooltip
bg="yellow",            # tooltip background color
fg="#666666",           # tooltip foreground color
pad=(3, 3),             # padding value (x, y)
xos=20,                 # x offset
yos=-10,                # y offset
size=7                  # font size

Set the tooltip calling this method using the following syntax:

your_widget.set(target_widget, tooltip_text, follow)

Three parameters can be set:

  1. target_widget.

    Which object will activate the tooltip. It can be a label, a button or any other tkinter widget

  2. tooltip_text.

    The actual text to be displayed on the tooltip.

    If no tooltip_text is provided the tooltip itself will be shown. This way you can setup complex tooltips by adding content to your_widget using standard tkinter methods.

  3. follow.

    Boolean value True or False. If set to true the tooltip will follow your mouse pointer. Default value is False

Demo examples

Inside the file called demo.py you will find examples of simple and advanced usage

Notes

  • The tooltip automatically changes its position if there's not enough space

Metadata

Release files for python-tkinter-tooltip 2.7.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-tkinter-tooltip 2.7.20
File Size Uploaded Provenance Actions
python_tkinter_tooltip-2.7.20.tar.gz 4.2 kB Without provenance Details for python_tkinter_tooltip-2.7.20.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-tkinter-tooltip 2.7.20
File Interpreter ABI Platform Actions
python_tkinter_tooltip-2.7.20-py3-none-any.whl Python 3 none any Details for python_tkinter_tooltip-2.7.20-py3-none-any.whl

Total release size: 9.6 kB

Release files / python_tkinter_tooltip-2.7.20.tar.gz

Download URL python_tkinter_tooltip-2.7.20.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
99f3480b8b69157017572da79288ebf976abb75415d808965c0f70194f241be5
BLAKE2b-256 checksum
How to use checksums
c01e2e6db391ab0fb3e04dfe041ac721f511a6ded03f1ce614659a058f17694c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / python_tkinter_tooltip-2.7.20-py3-none-any.whl

Download URL python_tkinter_tooltip-2.7.20-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe80d235e3ba61610538ef00e7740d32428b88fd8f3373066786739699fac345
BLAKE2b-256 checksum
How to use checksums
9d00416a09211cb975e8eaeb43bfcf1538fc28a59ad32dc1e32aedc22279404e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for python-tkinter-tooltip 2.7.20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page