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

Project page

www.egw.it/projects/tkinter-tooltip

Metadata

Release files for python-tkinter-tooltip 2.7.21

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.21
File Size Uploaded Provenance Actions
python_tkinter_tooltip-2.7.21.tar.gz 4.3 kB Without provenance Details for python_tkinter_tooltip-2.7.21.tar.gz

Built distribution (wheel)

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

Total release size: 9.7 kB

Release files / python_tkinter_tooltip-2.7.21.tar.gz

Download URL python_tkinter_tooltip-2.7.21.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9dbd5fa5d6bcf2f2269df210d6278ae048ca96aeb749b74db920f92c43b03773
BLAKE2b-256 checksum
How to use checksums
68494130de484dd4a533350566758187fe724c1f37c836e021c36761b80a2f71
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.21-py3-none-any.whl

Download URL python_tkinter_tooltip-2.7.21-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e392e9393db8f4ed038b16ee6271d4ec481c96500d2200f4c7fadc53c7c9fd4a
BLAKE2b-256 checksum
How to use checksums
2860619c147d196d8cced2fff5a05dea2419c4e94a43c0bcf3d61c13884137d7
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.21

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