Skip to main content

The MessageBox package for CustomTkinter

Project description

CustomTkinter Messagebox

CustomTkinter Messagebox is an implementation of the tkinter.messagebox functionalities using the customtkinter package. It replicates the same functions available in tkinter.messagebox, but with support for CustomTkinter's modernized interface.

Features

This package offers the following functionalities, replicating the behavior of tkinter.messagebox:

  • showinfo: Displays a dialog with an informational message.
  • showwarning: Displays a dialog with a warning message.
  • showerror: Displays a dialog with an error message.
  • askquestion: Displays a question and returns the user's response (Yes/No).
  • askokcancel: Displays a question and returns OK or Cancel.
  • askyesno: Displays a question and returns Yes or No.
  • askretrycancel: Displays an error message and asks the user to choose Retry or Cancel.

Installation

Install the package via pip:

pip install ctkmessagebox2

Project Structure

The project follows the same functional structure as tkinter.messagebox, allowing easy migration of code and adaptation to more modern interfaces with customtkinter.

Unlikely Tkinter messagebox, ctkmessagebox requires the master as the first argument for all messages.

Usage

Here’s a basic example of how to use the CustomTkinter Messagebox:

import customtkinter as ctk
import ctkmessagebox2

app = ctk.CTk()
app.geometry("400x200")


def show_info():
    ctkmessagebox2.showinfo(app, "Information", "This is an informational message.")


button = ctk.CTkButton(app, text="Show Info", command=show_info)
button.pack(pady=20)

app.mainloop()

Contributions

Contributions are welcome! If you want to improve the project, feel free to open an issue or submit a pull request.

Fork the repository

  • Create a branch (git checkout -b feature/new-feature)
  • Commit your changes (git commit -m 'Add new feature')
  • Push to the branch (git push origin feature/new-feature)
  • Open a Pull Request

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

ctkmessagebox2-0.2.0.tar.gz (87.2 kB view hashes)

Uploaded Source

Built Distribution

ctkmessagebox2-0.2.0-py3-none-any.whl (88.1 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