을 보여 조정하지하지만 스크롤이 위치Tkinter를 캔버스 스크롤하지만 스크롤은 캔버스 크기를 내가 스크롤 막대, 캔버스 스크롤 캔버스 내에서 프레임을 배치하려고
from tkinter import *
from tkinter import ttk
parent=Tk()
studentFrame=ttk.Frame(parent)
studentFrame.pack()
#settup the canvas
canvas=Canvas(studentFrame,width=700,height=300)
scroller=ttk.Scrollbar(studentFrame, orient=VERTICAL,command=canvas.yview)
canvas.grid(row=0,column=0,stick="nsew")
scroller.grid(row=0,column=1,stick="ns")
canvas.config(yscrollcommand=scroller.set)
list=ttk.Frame(canvas,width=700)
ttk.Label(list,text="S/N",width=10,relief=SUNKEN).grid(row=0,column=0,ipadx=3,ipady=3)
ttk.Label(list,text="Name",width=55,relief=SUNKEN).grid(row=0,column=1,ipadx=3,ipady=3)
ttk.Label(list,text="",width=15,relief=SUNKEN).grid(row=0,column=2,ipadx=3,ipady=3)
ttk.Label(list,text="",width=15,relief=SUNKEN).grid(row=0,column=3,ipadx=3,ipady=3)
num=0
r=0
while(r<50):
num=num+1
ttk.Label(list,text=num,width=10,relief=SUNKEN).grid(row=r,column=0,ipadx=3,ipady=3)
ttk.Label(list,text="NAME",width=55,relief=SUNKEN).grid(row=r,column=1,ipadx=3,ipady=3)
ttk.Label(list,text="EDIT",width=15,relief=SUNKEN).grid(row=r,column=2,ipadx=3,ipady=3)
ttk.Label(list,text="DELETE",width=15,relief=SUNKEN).grid(row=r,column=3,ipadx=3,ipady=3)
r=r+1
canvas.create_window((0,0),window=list,anchor=W)
canvas.config(scrollregion=canvas.bbox(ALL))
parent.mainloop()
데이터베이스를 사용하지 않도록 코드를 수정하면 도움이됩니다. 적절한 [MCVE] (http://www.stackoverflow.com/help/mcve)는 즉시 사용할 수 있어야합니다. 데이터가 데이터베이스에서 제공된다는 사실은이 문제와 관련이 없습니다. –