Tkinter Text widget with an extra hint attribute.
Project description
Hinted Text
Hinted text widget for tkinter.
This custom HintedText
class inherits from tk.Text
and adds a hint parameter in the constructor. The clear_hint
method is bound to the <FocusIn>
event and will clear the hint text if the widget has focus and the text is the same as the hint. The add_hint
method is bound to the <FocusOut>
event and will add the hint text back if the widget loses focus and the text is empty.
Installation
pip install hintedtext
Usage
import tkinter as tk
from hintedtext import HintedText, HintedEntry
root = tk.Tk()
text = HintedText(root, hint="Enter your text here")
text.pack()
entry = HintedEntry(root, hint="Enter your text here")
entry.pack()
root.mainloop()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hintedtext-0.6.0.tar.gz
(2.6 kB
view details)
Built Distribution
File details
Details for the file hintedtext-0.6.0.tar.gz
.
File metadata
- Download URL: hintedtext-0.6.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.3 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95655d3ad067c6b50fc58d1ed769f1192c0907a42efd2b0b6be079b9740d54c5 |
|
MD5 | dafafcbc7fcb73097ecc1b2ba10334ce |
|
BLAKE2b-256 | 9be16a0e0e40c332ef655d167c764134f7af5886145ab7c18813be14905e527d |
File details
Details for the file hintedtext-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: hintedtext-0.6.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.3 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 254272017fa9d0a5e6f0bc2595d0a82dcd34ab82effd2babb4e5f0aacd8cb24c |
|
MD5 | 08c7792783817e3d4b1d7753d20e5151 |
|
BLAKE2b-256 | d16bebab92d0b4ebde10578cb8b4da5776831a12c43adbc65f2e81dc2a3ef539 |