INNER CODE UNIT · Python
VisualTips
Qwejay/Qflow · main.py:232
class VisualTips:
@staticmethod
def show_toast(message, duration=2000, use_sound=False, position='center'):
try:
top = tk.Toplevel()
top.overrideredirect(True)
top.attributes("-topmost", True, "-alpha", 0.9)
top.configure(bg="#333333")
lbl = tk.Label(top, text=message, fg="white", bg="#333333", padx=20, pady=10, font=("Microsoft YaHei", 12, "bold"))
lbl.pack()
top.update_idletasks()
w, h = top.winfo_reqwidth(), top.winfo_reqheight()
sw, sh = top.winfo_screenwidth(), top.winfo_screenheight()
if position == 'bottom_right':
top.geometry(f"+{sw - w - 20}+{sh - h - 60}")