add vertical scroolbar
This commit is contained in:
parent
9d4c823729
commit
8deec4e75e
15
cave.py
15
cave.py
@ -1,5 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from tkinter import *
|
from tkinter import *
|
||||||
|
|
||||||
@ -59,15 +58,19 @@ class Etageres(object):
|
|||||||
def generate_windows(self):
|
def generate_windows(self):
|
||||||
self.fenetre=Tk()
|
self.fenetre=Tk()
|
||||||
self.fenetre.title(string="cave a vin")
|
self.fenetre.title(string="cave a vin")
|
||||||
|
|
||||||
|
etagere_frame=Frame(self.fenetre)
|
||||||
for etagere in self.etageres:
|
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)
|
framecontrol.grid(column=2,row=1)
|
||||||
Button(framecontrol,text="add etagere",command=lambda:self.click_add_etagere()).pack()
|
Button(framecontrol,text="add etagere",command=lambda:self.click_add_etagere()).pack()
|
||||||
Button(framecontrol,text="remove etagere").pack()
|
Button(framecontrol,text="remove etagere").pack()
|
||||||
Button(framecontrol,text="save",command=lambda:self.save_etageres("cave")).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):
|
def mainloop(self):
|
||||||
self.fenetre.mainloop()
|
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(1, 1, "rouge", "saint emilion", 2005))
|
||||||
#print(new.etageres[0].add_bouteille(9, 1, "rose", "gewurtz", 2010))
|
#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].add_bouteille(5, 2, "rouge", "saint emilion", 2006))
|
||||||
#
|
|
||||||
#print(new.etageres[0].bouteilles)
|
#print(new.etageres[0].bouteilles)
|
||||||
#
|
|
||||||
#print("vos etagére contiennes {} bouteille".format(new.nbbouteille()))
|
#print("vos etagére contiennes {} bouteille".format(new.nbbouteille()))
|
||||||
#print("vos etagére contiennes {} bouteille de rouge".format(
|
#print("vos etagére contiennes {} bouteille de rouge".format(
|
||||||
#new.nbbouteillecouleur("rouge")))
|
#new.nbbouteillecouleur("rouge")))
|
||||||
#
|
|
||||||
#print(new.couleur)
|
#print(new.couleur)
|
||||||
|
|
||||||
new.generate_windows()
|
new.generate_windows()
|
||||||
new.mainloop()
|
new.mainloop()
|
||||||
|
Loading…
Reference in New Issue
Block a user