-
Notifications
You must be signed in to change notification settings - Fork 2
/
DialogMessage.py
58 lines (36 loc) · 1.6 KB
/
DialogMessage.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from tkinter import *
class DialogMessage:
def __init__(self, parent,mensagem):
self.bExit = True
top = self.top = Toplevel(parent)
top.title('Mensagem Informativa')
Label(top, width= 60,wraplength=400,font =('curier',11) ,text=mensagem).pack()
b = Button(top, text="OK", command=self.ok)
b.pack(pady=5)
######################################################
# centraliza a janela
# Obtem a altura e largura da janela
windowWidth = parent.winfo_reqwidth()
windowHeight = parent.winfo_reqheight()
print("Width",windowWidth,"Height",windowHeight)
# Obtem a posicao central
positionRight = int(parent.winfo_screenwidth()/2 - windowWidth/2)
positionDown = int(parent.winfo_screenheight()/2 - windowHeight/2)
# centraliza a janela
top.geometry("+{}+{}".format(positionRight, positionDown))
def ok(self):
self.bExit = False
self.top.destroy()
############################
#root=Tk()
#sizex = 600
#sizey = 400
#posx = 20
#posy = 10
#root.wm_geometry("%dx%d+%d+%d" % (sizex, sizey, posx, posy))
#itemsforlistbox=['one','two','three','four','five','six','seven','eight 8888888888888888888888888888888888888888888']
#d = DialogMessage(root,'aaaaaaaaaaaaaaaaaaaaaatestand a mensagem asdf asdfasdfasd fas df asd fas7457457474574567 xbxcbxcbxcvbxcvbxcbxcbxcbxcbqqqqqqqqqqqqqqqqqqqqqqqqqqq')
#root.wait_window(d.top)
#print(d.valor)
#root.mainloop()
#############################