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
| from Tkinter import *
#global mov1
#sglobal mov2
mov1=0
mov2=0
def verif ():
fen1.update()
haut=regle1.get()
bas=regle2.get()
if(haut > bas):
anonce1.config(text='OK')
bou3.grid(row=2, column=3, padx=8, pady=5)
else:
anonce1.config(text='Merci de verifier')
bou3.grid_forget()
def mouvement1 (mov):
mov1=regle1.get()
#anonce1.config(text=mov1)
if(mov1 == 0):
mov1=mov
elif(mov1 != mov):
bou3.grid_forget()
anonce1.config(text='Merci de verifier')
def mouvement2(mov3):
mov2=regle1.get()
if(mov2 == 0):
mov2=mov
elif(mov2 != mov3):
bou3.grid_forget()
anonce1.config(text='Merci de verifier')
fen1 = Tk()
fen1.title("Video Surveillance")
titre = Label(fen1, text='Video Surveillance', fg='red')
titre.grid(row=0)
#svEntry = StringVar()
regle1 = Scale (from_=0, to=300, orient=HORIZONTAL, length=250, label='Bruit Haut :', tickinterval=50, command=mouvement1) #Scale page 186
regle2 = Scale (from_=0, to=300, orient=HORIZONTAL, length=250, label='Bruit Bas :', tickinterval=50, command=mouvement2)
regle1.grid(row=1, column=1)
regle2.grid(row=2, column=1)
bou3 = Button(fen1, text='lancer', width=8)
bou1 = Button(fen1, text='Quitter', width=8, command = fen1.destroy)
bou2 = Button(fen1, text='Verification', width=8, command =verif)
bou1.grid(row=3, column=3, padx=8, pady=5)
bou2.grid(row=1, column=3, padx=8, pady=5)
#les anonces
anonce1=Label(fen1, text='', fg='red')
anonce1.grid(row=4, column=0)
fen1.mainloop() |
Partager