add vertical scroolbar

This commit is contained in:
vincent 2018-02-10 22:16:46 +01:00
parent 9d4c823729
commit 8deec4e75e

15
cave.py
View File

@ -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()