# 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
```bash
pip install hintedtext
```
# Usage
```py
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()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/billyeatcookies/hintedtext",
"name": "hintedtext",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Billy",
"author_email": "billydevbusiness@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9b/e1/6a0e0e40c332ef655d167c764134f7af5886145ab7c18813be14905e527d/hintedtext-0.6.0.tar.gz",
"platform": null,
"description": "# Hinted Text \nHinted text widget for tkinter.\n\nThis 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.\n\n\n\n# Installation\n\n```bash\npip install hintedtext\n```\n\n# Usage\n\n```py\nimport tkinter as tk\nfrom hintedtext import HintedText, HintedEntry\n\nroot = tk.Tk()\ntext = HintedText(root, hint=\"Enter your text here\")\ntext.pack()\nentry = HintedEntry(root, hint=\"Enter your text here\")\nentry.pack()\nroot.mainloop()\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Tkinter Text widget with an extra hint attribute.",
"version": "0.6.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d16bebab92d0b4ebde10578cb8b4da5776831a12c43adbc65f2e81dc2a3ef539",
"md5": "08c7792783817e3d4b1d7753d20e5151",
"sha256": "254272017fa9d0a5e6f0bc2595d0a82dcd34ab82effd2babb4e5f0aacd8cb24c"
},
"downloads": -1,
"filename": "hintedtext-0.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "08c7792783817e3d4b1d7753d20e5151",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 3168,
"upload_time": "2023-02-02T10:21:55",
"upload_time_iso_8601": "2023-02-02T10:21:55.884790Z",
"url": "https://files.pythonhosted.org/packages/d1/6b/ebab92d0b4ebde10578cb8b4da5776831a12c43adbc65f2e81dc2a3ef539/hintedtext-0.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9be16a0e0e40c332ef655d167c764134f7af5886145ab7c18813be14905e527d",
"md5": "dafafcbc7fcb73097ecc1b2ba10334ce",
"sha256": "95655d3ad067c6b50fc58d1ed769f1192c0907a42efd2b0b6be079b9740d54c5"
},
"downloads": -1,
"filename": "hintedtext-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "dafafcbc7fcb73097ecc1b2ba10334ce",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 2641,
"upload_time": "2023-02-02T10:21:57",
"upload_time_iso_8601": "2023-02-02T10:21:57.610176Z",
"url": "https://files.pythonhosted.org/packages/9b/e1/6a0e0e40c332ef655d167c764134f7af5886145ab7c18813be14905e527d/hintedtext-0.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-02 10:21:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "billyeatcookies",
"github_project": "hintedtext",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "hintedtext"
}