我有一个链接到滚动条的表格。它可以工作,但是滚动条的高度很短。我该如何设置他的高度?
class table(ttk.Treeview):
def _init__(self,frame,scroll_width,list_height,side,x_crol,y_crol,lable_place_x,
lable_place_y):
self.side = side
scroll = Scrollbar(frame, orient="vertical", width=scroll_width)
scroll.pack(side=side)
scroll.place(x=x_crol, y=y_crol)
ttk.Treeview.__init__(self,frame, yscrollcommand=scroll.set, height=list_height)
self.pack(side=LEFT, padx=lable_place_x + 30, pady=lable_place_y + 50)
scroll.config(command=self.yview)
scroll_width=20
tab_side=LEFT
x=650
y= 160
frame=hospitalFrame
list_height=20
c = 80
lable_place_x = 80
lable_place_y=70
hospital_tabel=table(frame,scroll_width,list_height,tab_side,x,y,lable_place_x,
lable_place_y)
hospitalFrame.pack(fill='both',expand=1)
1条答案
按热度按时间0lvr5msh1#
你可以把滚动条放在一个单独的框架中并指定框架的高度,也可以在把滚动条放在框架中时写
expand = True, fill = BOTH
。