Skip to content

Latest commit

 

History

History
97 lines (69 loc) · 2.44 KB

README.md

File metadata and controls

97 lines (69 loc) · 2.44 KB

Custom Message Box library

Python Version License Status OS CustomTkinter

📝 Description

Custom Message Boxis simple and modern library to create custom dialog boxes with CustomTkinter. It allows you to easily retrieve user responses (inputs, confirmations, multiple choices) without having to deal with complex classes.

🖼️ Screenshoots

Screenshoot.

📦 Features

  • Information & Error: Simple notification boxes.
  • Yes/No: Confirmation dialog boxes.
  • Entry: Dialog boxes with text input.
  • Custom: Dialog boxes with 2 customized buttons.

🛠️ Installation

Make sure you have CustomTkinter installed:

pip install customtkinter

Install the library:

pip install Custom-message-box

Or download the script.

🚀 Usage

Quick start guide:

  • Information Message
custom_message_box.ctkinfo("Title", "Operation successful!")
  • Error Message
custom_message_box.ctkerror("Warning", "Connection lost.")
  • Confirmation Window Returns 1 for Yes and 0 for No.
response = custom_message_box.ctk_msg_yesno("Exit", "Do you really want to leave?")
  • Text Input Returns the entered string.
username = custom_message_box.ctk_msg_entry("Username", "Enter your name:", "e.g., John")
  • Custom Buttons Returns the text of the clicked button.
choice = custom_message_box.ctk_msg_custom("Menu", "Choose an option:","Play", "Options", "Exit")

💻 Full Integration Example

import custom_message_box.cmb as cmb

# 1. Test Entry
entry_response = cmb.ctk_msg_entry("Title", "Enter something:", "Placeholder")
print(entry_response)

# 2. Test YesNo
yesno_response = cmb.ctk_msg_yesno("Confirm", "Are you sure?")
print(yesno_response)

# 3. Test Custom (Title, Message, Text1, Text2)
custom_response = cmb.ctk_msg_custom("Choice", "Select one:", "Option 1", "Option 2")
print(custom_response)

# 4. Test Info
cmb.ctkinfo("Info", "Everything is OK!")

# 5. Test Error
cmb.ctkerror("Danger", "Something went wrong!")

Good programing !