From 357df063b7d5fb210800025f9e199df8094cb15c Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 11 Feb 2018 16:14:17 +0100 Subject: [PATCH] debut gestion scrool bar --- cave.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cave.py b/cave.py index 16efc5d..e5275c7 100644 --- a/cave.py +++ b/cave.py @@ -139,7 +139,10 @@ class EtageresUI(object): self.fenetre=Tk() self.fenetre.title(string="cave a vin") self.etageresUI=[] - self.etagere_frame=Frame(self.fenetre) + scrollbar = Scrollbar(self.fenetre,orient=VERTICAL) + scrollbar.grid(column=2,row=1,sticky=N+S) + self.etagere_frame=Canvas(self.fenetre,yscrollcommand=scrollbar.set) + scrollbar.config(command=self.etagere_frame.yview) for etagere in self.etageres: self.etageresUI.append(EtagereUI(etagere,self)) @@ -149,8 +152,7 @@ class EtageresUI(object): Button(framecontrol,text="remove etagere",command=self.click_remove_etagere).pack() Button(framecontrol,text="save",command=lambda:self.etageres.save_etageres("cave")).pack() self.etagere_frame.grid(column=1,row=1) - scrollbar = Scrollbar(self.fenetre,orient=VERTICAL) - scrollbar.grid(column=2,row=1,sticky=N+S) + def click_add_etagere(self): child_window=Toplevel(self.fenetre)