自动调整 guizero 窗口的大小
我编写了一个 guizero 代码,它根据所选内容创建一个新窗口,其中包含不同数量的信息。我只是想知道是否有一个功能可以调整窗口大小以适应所有信息。我目前只是将窗口设置得足够大以容纳最大量的信息,但我宁愿让它自动调整大小。 还有一个简单的功能,如果窗口大小改变,它里面的所有小部件也会改变大小?
I have written a guizero code that creates a new window with different amounts of information on it depending on what is selected. I was just wondering if there is a function to resize the window to fit all of the information. I am currently just making the window big enough to fit the largest amount of information but I would rather have it so it resizes it automatically.
And also is there a simple function so that if the window size is changed all of the widgets inside of it change size as well?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为不可能自动调整窗口大小,但您可以计算行数并调整窗口大小。
numLines*defaultHeightByLine + 其他元素的高度
I think is not possible to automaticly resize the window but you can count the number of lines and resize the window.
numLines*defaultHeightByLine + height of the other elements