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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
| from mtTkinter import*
class fenetre:
def __init__(self):
self.fen=Tk()
self.fen.geometry("800x800")
self.fen.wm_title("Interface restaurant")
self.see = True
#separation de la fenetre en panneaux
panneauTot = PanedWindow(self.fen,orient=HORIZONTAL,height=750,width=1000)
pGauche = PanedWindow(self.fen,orient=VERTICAL,height=750,width=500,bg='white')
self.pDroite = PanedWindow(self.fen,orient=VERTICAL,height=750,width=400,bg='white')
labelpDroite = Label(self.pDroite,text="Commandes",height=2,width=55,bg='#CAAD73')
labelpDroite.pack()
pGauche1 = PanedWindow(pGauche,orient=VERTICAL,height=400,width=500,bg='#F3DEB6')
pGauche2 = PanedWindow(pGauche,orient=VERTICAL,height=350,width=500,bg='#F3DEB6')
pGauche1.pack()
pGauche2.pack()
labelpGauche1 = Label(self.fen,text="Livreurs",height= 2,bg='#CAAD73')
pGauche1.add(labelpGauche1)
labelpGauche2 = Label(self.fen,text="Chiffre d'affaire",height = 2,bg='#CAAD73')
pGauche2.add(labelpGauche2)
bouton2 = Button(self.fen, text="Bouton provisoire 2", command=self.testBouton, height=3)
pGauche2.add(bouton2)
#Ajout des livreurs a droite de l'interface (3 sous forme de checkButton et 2 sous forme de label a nous de choisir ce qui est mieux)
self.var_livreur1= IntVar()
self.var_livreur1.set(0)
self.livreur1 = Checkbutton(self.fen,bg='white', text="Livreur 1",command =self.actionCheckbutton1, variable=self.var_livreur1, height=4)
self.var_livreur2= IntVar()
self.var_livreur2.set(0)
self.livreur2 = Checkbutton(self.fen,bg='white', text="Livreur 2",command =self.actionCheckbutton2, variable=self.var_livreur2, height=4)
self.var_livreur3= IntVar()
self.var_livreur3.set(0)
self.livreur3 = Checkbutton(self.fen,bg='white', text="Livreur 3",command =self.actionCheckbutton3, variable=self.var_livreur3, height=4)
self.livreur4 = Label(self.fen,text="Livreur 4",height = 4,bg='white')
self.livreur5 = Label(self.fen,text="Livreur 5",height = 3,bg='white')
pGauche1.add(self.livreur1)
pGauche1.add(self.livreur2)
pGauche1.add(self.livreur3)
pGauche1.add(self.livreur4)
pGauche1.add(self.livreur5)
#Ajout de la liste client a gauche : a relier a la partie reseau (utiliser la liste de client reseau pour remplir la liste)
#self.liste = Listbox(pDroite)
sbar = Scrollbar(self.pDroite)
#sbar.config(command=self.liste.yview)
#self.liste.config(yscrollcommand=sbar.set)
sbar.pack(side=RIGHT, fill=Y)
#for i in range(10):
# self.liste.insert(i, "Client-" + str(i))
#self.liste.pack(side=LEFT, expand=YES, fill=BOTH)
#pDroite.add(labelpDroite)
panneauTot.add(pGauche)
panneauTot.add(self.pDroite)
panneauTot.pack()
#self.fen.mainloop()
self.fen.update_idletasks()
self.fen.update()
def ajoutClient(self,num,statut):
label = Label(self.pDroite, text="CLient "+str(num)+": "+statut, bg="pink")
label.pack()
self.fen.update_idletasks()
self.fen.update()
def testBouton(self):
print ("coucou")
#Changement d'etat quand on clique sur les checkButton
def actionCheckbutton1(self):
if self.var_livreur1.get() == 1:
self.livreur1.configure(bg='red')
else :
self.livreur1.configure(bg='white')
def actionCheckbutton2(self):
if self.var_livreur2.get() == 1:
self.livreur2.configure(bg='red')
else :
self.livreur2.configure(bg='white')
def actionCheckbutton3(self):
if self.var_livreur3.get() == 1:
self.livreur3.configure(bg='red')
else :
self.livreur3.configure(bg='white') |
Partager