-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage_box.py
More file actions
47 lines (27 loc) · 900 Bytes
/
message_box.py
File metadata and controls
47 lines (27 loc) · 900 Bytes
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
39
40
41
42
43
44
45
46
47
'''
example by: dlefcoe
darren@redhedge.uk
twitter: @dlefcoe
the cuser cannot use pack and grid together.
ie. pack & grid are mutually exclusive.
frame lets both exist together.
'''
# imports
import tkinter as tk
# import os
# explicit imports
# from PIL import Image, ImageTk
from tkinter import messagebox
root = tk.Tk()
root.title('RedHedge - radio button example')
root.iconbitmap('RH_icon.ico')
def popup():
messagebox.showinfo('this is my popup', 'hello world')
messagebox.showwarning('this is my popup', 'warn warn warn !!!')
response = messagebox.askyesno('this is my popup', 'some question')
if response == 1:
tk.Label(root, text='well done').pack()
if response == 0:
tk.Label(root, text='also well done...').pack()
tk.Button(root, text='popup', command=popup).pack()
root.mainloop()