How to find out the current widget size in tkinter?

前端 未结 3 2053
不知归路
不知归路 2020-12-03 00:49

I\'m using Python and Tkinter, and I need to know the current dimensions (width, height) of a widget.

I\'ve tried somewidget[\"width\"]

3条回答
  •  执念已碎
    2020-12-03 01:22

    somewidget.winfo_width() and somewidget.winfo_height() give 1. You need to update Tk (issue tk.update()) before getting these values.

提交回复
热议问题