From 8deec4e75e16d4b3f868755405d88c5cd1d7a90d Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 10 Feb 2018 22:16:46 +0100 Subject: [PATCH] add vertical scroolbar --- cave.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cave.py b/cave.py index 2b6993b..1b86360 100644 --- a/cave.py +++ b/cave.py @@ -1,5 +1,4 @@ - import json from tkinter import * @@ -59,15 +58,19 @@ class Etageres(object): def generate_windows(self): self.fenetre=Tk() self.fenetre.title(string="cave a vin") + + etagere_frame=Frame(self.fenetre) for etagere in self.etageres: - etagere.generate_frame(self.fenetre) + etagere.generate_frame(etagere_frame) - framecontrol=LabelFrame(self.fenetre,text="command pannel") + framecontrol=LabelFrame(etagere_frame,text="command pannel") framecontrol.grid(column=2,row=1) Button(framecontrol,text="add etagere",command=lambda:self.click_add_etagere()).pack() Button(framecontrol,text="remove etagere").pack() Button(framecontrol,text="save",command=lambda:self.save_etageres("cave")).pack() - + etagere_frame.grid(column=1,row=1) + scrollbar = Scrollbar(self.fenetre,orient=VERTICAL) + scrollbar.grid(column=2,row=1,sticky=N+S) def mainloop(self): self.fenetre.mainloop() @@ -239,14 +242,10 @@ new = Etageres.load_etageres("cave") #print(new.etageres[0].add_bouteille(1, 1, "rouge", "saint emilion", 2005)) #print(new.etageres[0].add_bouteille(9, 1, "rose", "gewurtz", 2010)) #print(new.etageres[0].add_bouteille(5, 2, "rouge", "saint emilion", 2006)) -# #print(new.etageres[0].bouteilles) -# #print("vos etagére contiennes {} bouteille".format(new.nbbouteille())) #print("vos etagére contiennes {} bouteille de rouge".format( #new.nbbouteillecouleur("rouge"))) -# #print(new.couleur) - new.generate_windows() new.mainloop()