Quantcast
Channel: AFPy's Planet
Viewing all articles
Browse latest Browse all 3593

scrollbar-canvas

$
0
0

Bonjour,
j’ai un problème de dimension du “curseur” (Thumb) de mes scrollbars.
elles remplissent la scrollbar et je ne peux qu’utiliser les flèches pour me déplacer H ou V. Voici mon code:

Frame1 = Frame(fen, background='white')
Frame1.place(x=20, y=y5, width=w1, height=h1)
Frame2 = Frame(Frame1, background='white')
Frame2.place(x=5,y=5, width=w1-10,height=h1-10)
cnvs = Canvas(Frame2, bg='white', width=w1-10, height=h1-10)
cnvs.place(x=0,y=0)
scrollable_frame = Frame(cnvs)
scrollable_frame.bind("",lambda e: cnvs.configure(scrollregion=cnvs.bbox("all")))
cnvs.create_window((0, 0), window=scrollable_frame, anchor="nw")
scrollbarv = ttk.Scrollbar(Frame2, orient="vertical", command=cnvs.yview)
cnvs.configure(yscrollcommand=scrollbarv.set)
scrollbarv.pack(side="right", fill="y")
scrollbarh = ttk.Scrollbar(Frame2, orient="horizontal", command=cnvs.xview)
cnvs.configure(xscrollcommand=scrollbarh.set)
scrollbarh.pack(side="bottom", fill="x")
p=30
for n in range(1,300):
	cnvs.create_text(50, p, text=str(n)+' '+"Tkinter & azertyuiopqsdfghjklm",fill="black",font="Times 16 bold")
	p=p+30

J’y arrive avec une ListBox.
D’où pourrait venir mon erreur ?
Cordialement

7 messages - 3 participant(e)s

Lire le sujet en entier


Viewing all articles
Browse latest Browse all 3593

Trending Articles