Customtkinter Tooltip widget
Project description
CTkToolTip
Small tooltip pop-up label for displaying details on customtkinter widgets.
Features
- Display over any CTk widget
- Configurable options
- Transparency effect
- Round corners
- Can be used with CTkSlider to show the value
- Dynamic offset
- Add delays
Installation
pip install CTkToolTip
Example
Simple Usage:
CTkToolTip(widget, message="Your Message")
App Example:
import customtkinter
from CTkToolTip import *
def show_value(value):
tooltip_1.configure(message=int(value))
def show_text():
print(tooltip_2.get())
root = customtkinter.CTk()
slider = customtkinter.CTkSlider(root, from_=0, to=100, command=show_value)
slider.pack(fill="both", padx=20, pady=20)
tooltip_1 = CTkToolTip(slider, message="50")
button = customtkinter.CTkButton(root, command=show_text)
button.pack(fill="both", padx=20, pady=20)
tooltip_2 = CTkToolTip(button, delay=0.5, message="This is a CTkButton!")
root.mainloop()
Arguments
| Parameter | Description |
|---|---|
| widget | bind the tooltip to the ctk widget |
| message | show the message over the toolip |
| delay | add a small delay before showing the tooltip (default is 0.2) |
| follow | follow the mouse cursor while hovering (default is True) |
| x_offset | change the horizontal offset of the tooltip widget from mouse cursor |
| y_offset | change the vertical offset of the tooltip widget from mouse cursor |
| alpha | change the transparency effect of the tooltip (range: 0-1) |
| bg_color | change the background color of the tooltip |
| corner_radius | roundness of the corners |
| border_width | add a border around the tooltips (default is 0) |
| border_color | change the color of the border width |
| padding | add padx and pady inside the tooltip frame, tuple: (padx, pady) |
| text_color | change the text color of tooltip |
| wraplength | constrains the width of the tooltip, causing CTkToolTip, where required, to wrap the message at word boundaries. |
| font | label text font, tuple: (font_name, size) |
| justify | change the text display structure (left, right or center) |
| *Other Label Parameters | All other parameters for ctk label can be passed in ctktooltip |
Methods
-
.configure(message, arguments...)
configure the text and other parameters for the tooltip
-
.get()
get the current text of tooltip
-
.hide()
disables the tooltip from appearing
-
.show()
enable the tooltip again
-
.is_disabled()
check the tooltip state
Thats all about CTkToolTips, hope it will help in your project!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file CTkToolTip-0.8.tar.gz.
File metadata
- Download URL: CTkToolTip-0.8.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08596120b12c8fa9b9bff2931a3aef3a29719380def9a0a50380c3b6852b4564
|
|
| MD5 |
d16bda3cbcef0667bc57740d50796a10
|
|
| BLAKE2b-256 |
a74d0a9e703b0be6b36a12920c2f993c704a36a58df62552686d76a8c9e3886a
|
File details
Details for the file CTkToolTip-0.8-py3-none-any.whl.
File metadata
- Download URL: CTkToolTip-0.8-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd91fc208596e14d0eea03eaa57b0d6095be995538ce2b87538e4266fa7a753d
|
|
| MD5 |
6b637c01a9174af8f487effd5a8217a8
|
|
| BLAKE2b-256 |
aeb683d939da1d3e7d6b1202a8fe205b3fc08ef7a570dd6dfc18026bf144594c
|