CTkMessagebox
CTkMessagebox copied to clipboard
Texts not filling the window
Displaying large texts will stretch the window down, with text aligning to center. I want it to fill up the windows width to look like a normal notification popup. even increasing the messagebox width didn't help. Ir just make it look ugly.
my code
import threading
from CTkMessagebox import CTkMessagebox
import customtkinter
import time
message = """
Subject: Exciting News! [Your Software Name] Update Available 🚀
---
Hello [Software User],
Great news! We've just rolled out a new update for [Your Software Name] to enhance your user experience. 🌟
What's new:
- [Feature 1]: [Brief description]
- [Feature 2]: [Brief description]
- [Bug fixes and improvements]
To enjoy the latest improvements and features, simply update your app to the latest version now.
Thank you for being a valued member of our [Your Software Name] community! If you have any feedback or encounter any issues, feel free to reach out to our support team.
Happy exploring!
The [Your Company/Software Name] Team 🚀
"""
def show_info():
# Default messagebox for showing some information
CTkMessagebox(title="Exciting News! YORRU TRAFFIC AI Update Available 🚀", height=50, title_color="green", sound=True, message=message)
def delayed_show_info():
time.sleep(1) # Wait for 10 seconds
show_info()
app = customtkinter.CTk()
app.rowconfigure((0, 1, 2, 3, 4, 5), weight=1)
app.columnconfigure(0, weight=1)
app.minsize(1000, 650)
notification = "true"
if notification == "true":
# Create a separate thread to delay the notification
thread = threading.Thread(target=delayed_show_info)
thread.start()
app.mainloop()
`
@wealthr This widget is not suitable for displaying large text. However, you can change the text length like this:
box = CTkMessagebox(title="Exciting News! YORRU TRAFFIC AI Update Available", width=500, title_color="green", sound=True, icon="", message=message)
box.info._text_label.configure(wraplength=450)
added wraplength parameter.