[](https://www.python.org)
[](https://opensource.org/licenses/MIT)
# tk-alert
Lightweight, self-contained package for sending GUI alerts using tkinter.
## Table of Contents
1. **[Introduction](#tk-alert)**
2. **[Features](#features)**
3. **[Usage](#usage)**
- **[Setup](#1-setup)**
- **[Example Code](#2-example-code)**
- **[Default Alert Design](#3-default-alert-design)**
5. **[Roadmap Items](#roadmap-items)**
6. **[License](#license)**
## Features
🚀 Minimal setup for sending GUI alerts in a Tkinter app
🎨 Highly customizable Alert widget with a modern design by default
🛠️ Ease of use out-of-the-box
## Usage
This example demonstrates how to create a basic Tkinter window and utilize the `tk-alert` library to display an alert notification when a button is clicked.
### 1. Setup
First, install the library using pip:
```sh
pip install tk-alert
```
### 2. Example Code
```python
import tkinter as tk
import tk_alert as tk_a
if __name__ == "__main__":
app = tk.Tk()
app.geometry("800x800")
alert_generator = tk_a.AlertGenerator(app)
show_notification_btn = tk.Button(app)
show_notification_btn.configure(
text="Send Alert",
command=lambda: alert_generator.send(
text="Alert information: Lorem Ipsum Dolor Sit Amet",
type=tk_a.AlertType.INFO,
anchor=tk.NW,
duration=5
),
)
show_notification_btn.pack()
app.mainloop()
```
### 3. Default Alert Design
<img src="https://github.com/DragosPancescu/tk-alert/blob/main/resources/AlertsDesign.png" width="410" height="202">
## Roadmap Items
This package is a **work in progress**. Below is the roadmap for the upcoming developments I wish to implement:
- **Tooltip on Hover**: Whenever the text inside the alert is truncated, a tooltip should appear on hover.
- **Support for Multiple Python 3 Versions**: Extend compatibility to support multiple versions of Python 3.
- **Tests**: Implement testing to ensure code reliability.
- **Configuration System for the AlertGenerator Class**: Develop a configuration system where a config object can be created and injected into the class. This will eliminate the need to pass configurations at runtime every time the `.send()` method is called.
- **Better Icon Support**: Enhance icon support, allowing users to change icons rather than relying on predefined options.
- **Minimum Width Constraint**: Implement a feature to constrain the alert with a `min_width` argument.
- **Animations**: Implement an animation system.
## License
This project is licensed under the **MIT License**. See the [LICENSE](https://github.com/DragosPancescu/tk-alert/blob/main/LICENSE.txt) file for more details.
Raw data
{
"_id": null,
"home_page": "https://github.com/DragosPancescu/tk-alert",
"name": "tk-alert",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Dragos Pancescu",
"author_email": "dragos.pnc@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e1/f7/51d339ac28650f8b9be19646b591a76b9ccb002ea787645237922af64b8e/tk_alert-0.0.1.tar.gz",
"platform": null,
"description": "[](https://www.python.org)\r\n[](https://opensource.org/licenses/MIT)\r\n \r\n# tk-alert\r\n\r\nLightweight, self-contained package for sending GUI alerts using tkinter.\r\n\r\n## Table of Contents\r\n\r\n1. **[Introduction](#tk-alert)** \r\n2. **[Features](#features)** \r\n3. **[Usage](#usage)** \r\n - **[Setup](#1-setup)** \r\n - **[Example Code](#2-example-code)** \r\n - **[Default Alert Design](#3-default-alert-design)** \r\n5. **[Roadmap Items](#roadmap-items)** \r\n6. **[License](#license)** \r\n \r\n## Features\r\n\r\n\ud83d\ude80 Minimal setup for sending GUI alerts in a Tkinter app\r\n\r\n\ud83c\udfa8 Highly customizable Alert widget with a modern design by default\r\n\r\n\ud83d\udee0\ufe0f Ease of use out-of-the-box\r\n \r\n## Usage\r\n\r\nThis example demonstrates how to create a basic Tkinter window and utilize the `tk-alert` library to display an alert notification when a button is clicked.\r\n\r\n### 1. Setup\r\n\r\nFirst, install the library using pip:\r\n\r\n```sh\r\npip install tk-alert\r\n```\r\n\r\n### 2. Example Code\r\n\r\n```python\r\nimport tkinter as tk\r\nimport tk_alert as tk_a\r\n\r\nif __name__ == \"__main__\":\r\n app = tk.Tk()\r\n app.geometry(\"800x800\")\r\n\r\n alert_generator = tk_a.AlertGenerator(app)\r\n\r\n show_notification_btn = tk.Button(app)\r\n show_notification_btn.configure(\r\n text=\"Send Alert\",\r\n command=lambda: alert_generator.send(\r\n text=\"Alert information: Lorem Ipsum Dolor Sit Amet\",\r\n type=tk_a.AlertType.INFO,\r\n anchor=tk.NW,\r\n duration=5\r\n ),\r\n )\r\n show_notification_btn.pack()\r\n\r\n app.mainloop()\r\n```\r\n### 3. Default Alert Design\r\n\r\n<img src=\"https://github.com/DragosPancescu/tk-alert/blob/main/resources/AlertsDesign.png\" width=\"410\" height=\"202\">\r\n\r\n## Roadmap Items\r\n\r\nThis package is a **work in progress**. Below is the roadmap for the upcoming developments I wish to implement:\r\n\r\n- **Tooltip on Hover**: Whenever the text inside the alert is truncated, a tooltip should appear on hover.\r\n- **Support for Multiple Python 3 Versions**: Extend compatibility to support multiple versions of Python 3.\r\n- **Tests**: Implement testing to ensure code reliability.\r\n- **Configuration System for the AlertGenerator Class**: Develop a configuration system where a config object can be created and injected into the class. This will eliminate the need to pass configurations at runtime every time the `.send()` method is called.\r\n- **Better Icon Support**: Enhance icon support, allowing users to change icons rather than relying on predefined options.\r\n- **Minimum Width Constraint**: Implement a feature to constrain the alert with a `min_width` argument.\r\n- **Animations**: Implement an animation system.\r\n\r\n## License\r\n\r\nThis project is licensed under the **MIT License**. See the [LICENSE](https://github.com/DragosPancescu/tk-alert/blob/main/LICENSE.txt) file for more details.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Tkinter based package for sending GUI alerts / notifications.",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/DragosPancescu/tk-alert"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eae9916909dc6b4a3eac760af93d51439eb308ed8e718cd97f3f3a6bffe3f16f",
"md5": "d9469d8265f16cef28b4a1822107d918",
"sha256": "d735237e33886aab6c447c092e43deb4c8620cea6163d2763d0ac0e49e0fc079"
},
"downloads": -1,
"filename": "tk_alert-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d9469d8265f16cef28b4a1822107d918",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 10435,
"upload_time": "2024-08-06T18:05:55",
"upload_time_iso_8601": "2024-08-06T18:05:55.327986Z",
"url": "https://files.pythonhosted.org/packages/ea/e9/916909dc6b4a3eac760af93d51439eb308ed8e718cd97f3f3a6bffe3f16f/tk_alert-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e1f751d339ac28650f8b9be19646b591a76b9ccb002ea787645237922af64b8e",
"md5": "aaadd1bf9c9c334e279e4640f2440cfb",
"sha256": "949fb47671bec06bf3ec0c4556574f09121edba77b0772abc5a4494cd3f54bf8"
},
"downloads": -1,
"filename": "tk_alert-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "aaadd1bf9c9c334e279e4640f2440cfb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 11077,
"upload_time": "2024-08-06T18:05:56",
"upload_time_iso_8601": "2024-08-06T18:05:56.555758Z",
"url": "https://files.pythonhosted.org/packages/e1/f7/51d339ac28650f8b9be19646b591a76b9ccb002ea787645237922af64b8e/tk_alert-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-06 18:05:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DragosPancescu",
"github_project": "tk-alert",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tk-alert"
}