2017-10-07 9 views
0

Code pertinent: Code pertinent: Code pertinent: Code pertinent: Code pertinent: Code pertinent: Code pertinent: Code pertinent: Code pertinent: Code pertinent: Code pertinent: Code pertinent:Pourquoi la barre d'outils ne fonctionne pas correctement ici (AWS)

self.propertyListWrapper = ttk.Frame(self.propertyMenu) 
self.propertyListWrapper.pack(fill = tk.BOTH, expand = tk.YES) 
self.propertyListCanvas = tk.Canvas(self.propertyListWrapper) 
self.propertyListCanvas.pack(fill = tk.BOTH, expand = tk.YES, side = tk.LEFT) 
self.propertyGrid = ttk.Frame(self.propertyListCanvas) 
self.propertyListScrollbar = ttk.Scrollbar(self.propertyListWrapper) 
self.propertyListScrollbar.config(command = 
self.propertyListCanvas.yview) 
self.propertyListCanvas.config(yscrollcommand = 
self.propertyListScrollbar.set)  
self.propertyListScrollbar.pack(side = tk.RIGHT, fill = tk.Y) 


self.propertyListCanvas.config(scrollregion = (0, 0, 
self.propertyGrid.winfo_width(), self.propertyGrid.winfo_height())) 
self.propertyListCanvas.create_window((0,0), window = self.propertyGrid, anchor='nw') 
+0

La barre de défilement devient-elle visible? Y a-t-il des codes d'erreur? – Rob

+0

Copie possible de [Problèmes avec les barres de défilement de la toile dans Tkinter] (https://stackoverflow.com/questions/27390899/issues-with-canvas-scrollbars-in-tkinter) – Rob

Répondre

0

pour la toile pour pouvoir faire défiler le cadre, le cadre doit être ajouté à la toile avec la méthode create_window. Vous ne pouvez pas utiliser pack.