est mon code THis GUI tkinter:
from tkinter import *;
from tkinter import ttk
# import tix as tk
class pryprotclass:
def onFrameConfigure(self, event,canvas1):
canvas1.configure(scrollregion=canvas1.bbox("all"))
def __init__(self,master):
frame2=Frame(master);
frame2.configure(background='yellow')
frame2.pack_propagate(False) ;
frame2.pack(fill="both", expand=True,side=RIGHT);
canvas1 = Canvas(frame2, borderwidth=0, background="#ffffff")
canvas1.configure(scrollregion=canvas1.bbox("all"))
frame3=Frame(canvas1);
vsb = Scrollbar(frame3, orient="vertical", command=canvas1.yview)
canvas1.configure(yscrollcommand=vsb.set)
vsb.pack(side="right", fill="y")
canvas1.pack(side="left", fill="both", expand=True)
canvas1.create_window((4,4), window=frame3, anchor="nw")
canvas1.configure(scrollregion=canvas1.bbox("all"))
frame3.bind("<Configure>"),
canvas1.configure(scrollregion=canvas1.bbox("all"))
frame3.config(width=240);
frame3.configure(background='purple')
frame3.pack_propagate(False) ;
maintenant il y a environ 40 étiquettes maintenant ils prennent toute la direction yPourquoi la barre de défilement ne fonctionne-t-elle pas?
Voir image-- https://imgur.com/Epq6vJJ
Quelle est l'erreur le code?
La barre de défilement ne fonctionne pas non plus et je ne peux pas voir la barre dans la barre de défilement pour monter ou descendre?
ici est le code demandé (unneccessary)
label=Label(frame3,text='ALL TASKS')
label.configure(background="WHITE",font="Courier 14 bold")
label.pack(side=TOP,anchor="nw",padx=10,pady=10)
chromelogo=PhotoImage(file="./Images/chrome.gif")
chromelogo=chromelogo.subsample(16,16)
labelchrome=Label(frame3,text="Chrome")
labelchrome.config(image=chromelogo)
labelchrome.config(background='WHITE')
labelchrome.config(compound='left')
labelchrome.image=chromelogo
labelchrome.pack(side=TOP,anchor="nw")
c1=Checkbutton(frame3,text="History")
c2=Checkbutton(frame3,text="Cookies")
c3=Checkbutton(frame3,text="Saved Passwords")
c4=Checkbutton(frame3,text="Download History")
c5=Checkbutton(frame3,text="Last Download Location")
c1.config(background='WHITE')
c2.config(background='WHITE')
c3.config(background='WHITE')
c4.config(background='WHITE')
c5.config(background='WHITE')
c1.pack(anchor="nw",padx=30)
c2.pack(anchor="nw",padx=30)
c3.pack(anchor="nw",padx=30)
c4.pack(anchor="nw",padx=30)
c5.pack(anchor="nw",padx=30)
firefoxlogo=PhotoImage(file="./Images/firefox.gif")
firefoxlogo=firefoxlogo.subsample(18,18)
labelfirefox=Label(frame3,text="Firefox")
labelfirefox.config(background='WHITE')
labelfirefox.config(image=firefoxlogo)
labelfirefox.config(compound='left')
labelfirefox.image=firefoxlogo
labelfirefox.pack(side=TOP,anchor="nw")
c6=Checkbutton(frame3,text="History")
c7=Checkbutton(frame3,text="Cookies")
c8=Checkbutton(frame3,text="Saved Passwords")
c9=Checkbutton(frame3,text="Internet Cache")
c10=Checkbutton(frame3,text="Saved Form Information")
c6.config(background='WHITE')
c7.config(background='WHITE')
c8.config(background='WHITE')
c9.config(background='WHITE')
c10.config(background='WHITE')
c6.pack(anchor="nw",padx=30)
c7.pack(anchor="nw",padx=30)
c8.pack(anchor="nw",padx=30)
c9.pack(anchor="nw",padx=30)
c10.pack(anchor="nw",padx=30)
iexplorelogo=PhotoImage(file="./Images/iexplore.gif")
iexplorelogo=iexplorelogo.subsample(12,12)
labeliexplore=Label(frame3,text="Internet Explorer")
labeliexplore.config(image=iexplorelogo)
labeliexplore.config(background='WHITE')
labeliexplore.config(compound='left')
labeliexplore.image=iexplorelogo
labeliexplore.pack(side=TOP,anchor="nw")
c11=Checkbutton(frame3,text="History")
c12=Checkbutton(frame3,text="Cookies")
c13=Checkbutton(frame3,text="Last Download Location")
c14=Checkbutton(frame3,text="Temporary Internet Files")
c15=Checkbutton(frame3,text="Autocomplete Form History")
c11.config(background='WHITE')
c12.config(background='WHITE')
c13.config(background='WHITE')
c14.config(background='WHITE')
c15.config(background='WHITE')
c11.pack(anchor="nw",padx=30)
c12.pack(anchor="nw",padx=30)
c13.pack(anchor="nw",padx=30)
c14.pack(anchor="nw",padx=30)
c15.pack(anchor="nw",padx=30)
explorerlogo=PhotoImage(file="./Images/explorer.gif")
explorerlogo=explorerlogo.subsample(16,16)
explorerlabel=Label(frame3,text="Windows Explorer")
explorerlabel.config(image=explorerlogo)
explorerlabel.config(background='WHITE')
explorerlabel.config(compound='left')
explorerlabel.image=explorerlogo
explorerlabel.pack(side=TOP,anchor="nw")
c16=Checkbutton(frame3,text="Recent Documents")
c17=Checkbutton(frame3,text="Run(in Start Menu)")
c18=Checkbutton(frame3,text="Network Passwords")
c16.config(background='WHITE')
c17.config(background='WHITE')
c18.config(background='WHITE')
c16.pack(anchor="nw",padx=30)
c17.pack(anchor="nw",padx=30)
c18.pack(anchor="nw",padx=30)
systemlogo=PhotoImage(file="./Images/system.gif")
systemlogo=systemlogo.subsample(16,16)
systemlabel=Label(frame3,text="System")
systemlabel.config(image=systemlogo)
systemlabel.config(background='WHITE')
systemlabel.config(compound='left')
systemlabel.image=systemlogo
systemlabel.pack(side=TOP,anchor="nw")
c19=Checkbutton(frame3,text="Recycle Bin")
c20=Checkbutton(frame3,text="Temporary Files")
c21=Checkbutton(frame3,text="Clipboard")
c22=Checkbutton(frame3,text="DNS Cache")
#c23=Checkbutton(frame3,text="add")
c19.config(background='WHITE')
c20.config(background='WHITE')
c21.config(background='WHITE')
c22.config(background='WHITE')
c19.pack(anchor="nw",padx=30)
c20.pack(anchor="nw",padx=30)
c21.pack(anchor="nw",padx=30)
c22.pack(anchor="nw",padx=30)
frame3.pack(fill="y", expand=False,side="left");
frame4=Frame(frame2);
frame4.configure(background='PINK')
frame4.pack_propagate(False) ;
frame5=Frame(frame4)
frame5.configure(background='green')
progressbar=ttk.Progressbar(frame4,orient=HORIZONTAL)
progressbar.pack(fill=BOTH,padx=20,pady=15)
run_PryPro=Button(frame4,text="RUN")
frame5.configure(height=300)
frame5.pack(fill=BOTH,expand=True,padx=20)
run_PryPro.pack(padx=60,pady=25,ipadx=20,ipady=10)
frame4.packfill="both", expand=True,side="right");
principal code de classe comme == demandé
from tkinter import * ;
from lefttoolbar import *;
from pyprot import *;
from logotop import *;
root=Tk()
obj_pryprot=pryprotclass(root);
=root.minsize(800, 500);
root.mainloop();
Vous avez posé la même question hier ... – DavidG
https://stackoverflow.com/questions/46624488/why-is-the-scrollbar-not-working -in-heretkinterpython-3-4 – DavidG
Pourquoi pensez-vous que la barre de défilement devrait fonctionner? La toile n'a qu'un seul objet, un petit cadre. Il n'y a rien à faire défiler. –