Repository navigation
Expand file tree
/
Copy pathMessage.py
More file actions
70 lines (53 loc) · 1.92 KB
/
Copy pathMessage.py
File metadata and controls
70 lines (53 loc) · 1.92 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from Tkinter import *
class Message(object):
def __init__(self, root, color, message):
self.root = root
self.font = ('Times', 12, 'roman')
self.color = color
self.message = message
self.screen_width = self.root.winfo_screenwidth()
self.screen_height = self.root.winfo_screenheight()
self.height = self.screen_height / 4
self.width = self.screen_width / 4
self.gui_init()
def gui_init(self):
self.root.title("Message")
self.root.resizable(width=False, height=False)
self.frame = Frame(
self.root,
cursor='hand1',
bg=self.color,
height=self.height,
width=self.width,
relief=RAISED,
bd=5)
self.frame.grid_propagate(0)
self.frame.pack(expand=True, side=TOP, fill=BOTH)
#creating labels
topFrame = Frame(
self.frame,
cursor='hand1',
bg=self.color,
height=self.height * 8 / 10,
width=self.width)
topFrame.grid_propagate(0)
topFrame.pack(expand=True, fill=BOTH, side=TOP)
downFrame = Frame(
self.frame,
cursor='hand1',
bg=self.color,
height=self.height * 2 / 10,
width=self.width)
downFrame.grid_propagate(0)
downFrame.pack(expand=True, fill=BOTH, side=TOP)
messageLabel = Label(
topFrame, text=self.message, font=self.font, bg=self.color)
messageLabel.place(relx=0.5, rely=0.5, anchor='center')
#creating login button
okButton = Button(downFrame, text="OK", font=('Times', 20, 'roman'))
okButton.bind("<Button-1>", self.__ok)
okButton.place(relx=0.5, rely=0.5, anchor='center')
def __ok(self, event):
for child in self.root.winfo_children():
child.destroy()
self.root.destroy()