开发者

TKinter: how to change Frame width dynamically

开发者 https://www.devze.com 2023-01-20 08:53 出处:网络
how can I set w开发者_JS百科idth to a tk.Frame (post-initialization ?) In other words, is there a member function to do it ? Sometheing like frame.setWidth()

how can I set w开发者_JS百科idth to a tk.Frame (post-initialization ?)

In other words, is there a member function to do it ? Sometheing like frame.setWidth()

thanks


frame.config(width=100)

Be aware that if there are children in the frame that are managed by grid or pack, your changes may have no effect. There are solutions to this, but it is rarely needed. Generally speaking you should let widgets be their natural size. If you do need to resize a frame that is a container of other widgets you need to turn "geometry propagation" off.

0

精彩评论

暂无评论...
验证码 换一张
取 消