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
orCancel
. - askyesno: Displays a question and returns
Yes
orNo
. - askretrycancel: Displays an error message and asks the user to choose
Retry
orCancel
.
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
Built Distribution
Hashes for ctkmessagebox2-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57bf8372290ed8bba05f2c6634c96821d8ddc0f92748cda1a775a881d324fe94 |
|
MD5 | 275b7f447d11b002ef7633159f69533c |
|
BLAKE2b-256 | 7e41bdd6380d83fee201fbe1966bca3e33cb813dd703bcd4680133042cb2f003 |