-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmbox.py
38 lines (27 loc) · 883 Bytes
/
mbox.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from tkinter import *
import ttkbootstrap as tb
from ttkbootstrap.dialogs import Messagebox
root = tb.Window(themename="superhero")
#root = Tk()
root.title("TTK Bootstrap! Message Box")
# Main App Icon
root.iconbitmap('images/codemy.ico')
# Message Box Icon
root.iconbitmap(default='images/codemy.ico')
root.geometry('700x350')
def clicker():
# create a dialog
# yesno, ok, okcancel, show_info, show_error, show_question
# show_warning, yesnocancel, retrycancel
mb = Messagebox.retrycancel("Display Some Message Here", "Here is the Title")
#if mb == "No":
# print("no")
#else:
# print("yes")
# Display button click
my_label.config(text=f'You Clicked {mb}')
my_button = tb.Button(root, text="Click Me!", bootstyle='danger', command=clicker)
my_button.pack(pady=40)
my_label = tb.Label(root, text='', font=("Helvetica", 18))
my_label.pack(pady=20)
root.mainloop()