以下是我的代码:
dialog_canvas = Canvas(dialog_frame, scrollregion = (0, 0, 450, 265), bg = 'white')
dialog_canvas.pack(expand = YES, fill = BOTH, side = LEFT)
yscroll = ttk.Scrollbar(root, orient = VERTICAL, command = dialog_canvas.yview)
dialog_canvas.config(yscrollcommand = yscroll.set)
yscroll.grid(row = 1, column = 1, sticky = 'ns')