Skip to main content

Tkinter based package for sending GUI alerts / notifications.

Project description

python License: MIT PyPI - Downloads

tk-alert

Lightweight, self-contained package for sending GUI alerts using tkinter.

Table of Contents

  1. Introduction
  2. Features
  3. Usage
  4. Roadmap Items
  5. 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:

pip install tk-alert

2. Example Code

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

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 file for more details.

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

tk_alert-0.0.2.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

tk_alert-0.0.2-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file tk_alert-0.0.2.tar.gz.

File metadata

  • Download URL: tk_alert-0.0.2.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.2

File hashes

Hashes for tk_alert-0.0.2.tar.gz
Algorithm Hash digest
SHA256 212f18c954b10a05f05fe6788ed5f6594fc777682802ce2c2546ca0ceb10e456
MD5 527c8b52e2e0eea82d734a1e95ca9ba6
BLAKE2b-256 1149dfc2fda22f57415b0b1fb1bb8c0f49a2139a081e854e1cbb2770f8fe8d90

See more details on using hashes here.

File details

Details for the file tk_alert-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: tk_alert-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.2

File hashes

Hashes for tk_alert-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7bc1847d4957ef28c093611d752a618cea29b0ff3fc611ef7f983dcedc4121e5
MD5 82fd2f8c1a5335f2da16c1c3f1529f4c
BLAKE2b-256 b9f7b43aa53514dba5dc8fbb870beb0a837d2d48801516f656bd0f9edfdb7cc3

See more details on using hashes here.

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