Tkinter: How to get frame in canvas window to expand to the size of the canvas?

前端 未结 2 941
一向
一向 2020-11-27 20:30

So I\'ve been using the canvas widget in tkinter to create a frame full of labels which has a scrollbar. All is working good except that the frame only expands to the size o

2条回答
  •  时光说笑
    2020-11-27 20:43

    Set a binding on the canvas event, which fires whenever the canvas changes size. From the event object you can get the canvas width and height, and use that to resize the frame.

提交回复
热议问题