Skip to main content

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 hashes)

Uploaded Source

Built Distribution

hintedtext-0.6.0-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page