自动调整 guizero 窗口的大小

发布于 2025-01-15 10:53:35 字数 154 浏览 0 评论 0原文

我编写了一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

今天小雨转甜 2025-01-22 10:53:35

我认为不可能自动调整窗口大小,但您可以计算行数并调整窗口大小。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文