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
| #coding:utf-8
from tkinter import *
import tkinter
#####################
## PAGE DE BOUTONS ##
#####################
PageBouton = tkinter.Tk()
PageBouton.geometry("800x480") #Resolution de la page bouton
PageBouton.resizable(width="false", height="false") #Bloquer le format de la page
PageBouton.title("Page de boutons") #Titre de la page bouton
canvas = Canvas (PageBouton, height=480, width=800,) #Permets la création d'un champ
ligne1 = canvas.create_line(0,80,800,80) #Permets de faire la ligne supérieur
ligne2 = canvas.create_line(0,410,800,410) #Permets de faire la ligne inférieur
canvas.pack()
photo = PhotoImage (file="sicos.png") #Intégration de la photo SICOS
canvas2 = Canvas(PageBouton,width=10, height=10) #Création du champ pour intégrer la photo
canvas2.create_image(0,0,anchor=NW, image=photo)
canvas2.place(x=0, y=0, width=240, height=80) #Emplacement sur l'IHM de l'image
photo2 = PhotoImage (file="Logo_PouchainV.png") #Intégration de la photo Pouchain
canvas3 = Canvas(PageBouton,width=10, height=10) #Création du champ pour intégrer la photo
canvas3.create_image(0,0,anchor=NW, image=photo2)
canvas3.place(x=720, y=0, width=300, height=80) #Emplacement sur l'IHM de l'image
Label(PageBouton,text='VARIABLE_OPERATEUR').place(x=490, y=30) #Affichage variable opérateur
Label(PageBouton,text='DATE_HEURE',).place(x=300, y=30) #Affichage heure et date
btn1 = tkinter.Button(PageBouton, text="MP2749", bg="light blue") #Bouton du produit 1
btn2 = tkinter.Button(PageBouton, text="MP52390", bg="yellow") #Bouton du produit 2
btn3 = tkinter.Button(PageBouton, text="MP71148", bg="black", fg="white") #Bouton du produit 3
btn4 = tkinter.Button(PageBouton, text="MP2146", bg="ivory2") #Bouton du produit 4
btn5 = tkinter.Button(PageBouton, text="MP619", bg="deep pink") #Bouton du produit 5
btn6 = tkinter.Button(PageBouton, text="MP53", bg="green") #Bouton du produit 6
btn1.place(x=90, y=90, width=175, height=150) #Placement du bouton sur la page
btn2.place(x=310, y=90, width=175, height=150) #Placement du bouton sur la page
btn3.place(x=530, y=90, width=175, height=150) #Placement du bouton sur la page
btn4.place(x=90, y=250, width=175, height=150) #Placement du bouton sur la page
btn5.place(x=310, y=250, width=175, height=150) #Placement du bouton sur la page
btn6.place(x=530, y=250, width=175, height=150) #Placement du bouton sur la page
Label(PageBouton,text="Raccroché",fg="white",bg="black").place(x=590, y=200) #Affichage du texte produit
Label(PageBouton,text="Raccroché",fg="black",bg="light blue").place(x=150, y=200) #Affichage du texte produit
Label(PageBouton,text="Raccroché",fg="black",bg="yellow").place(x=370, y=200) #Affichage du texte produit
Label(PageBouton,text="Raccroché",fg="black",bg="ivory2").place(x=150, y=360) #Affichage du texte produit
Label(PageBouton,text="Raccroché",fg="black",bg="deep pink").place(x=370, y=360) #Affichage du texte produit
Label(PageBouton,text="Raccroché",fg="black",bg="green").place(x=590, y=360) #Affichage du texte produit
def quitter(): #Permets de quitter la page boutons
PageBouton.destroy()
BtnHisto = tkinter.Button(PageBouton, text="Historique", bg='AntiqueWhite3') #Bouton pour afficher la page historique
BtnHisto.place(x=60, y=420, width=200, height=50) #Placement du bouton sur la page
BtnEteindre = tkinter.Button(PageBouton,text="OFF",bg='AntiqueWhite3',command=quitter) #Bouton qui sert de quitter le raspberry
BtnEteindre.place(x=540, y=420, width=200, height=50) #Placement du bouton sur la page
PageBouton.mainloop() |
Partager