如何让 wxFrame 刷新而无需在 wxPython 中手动调整其大小?

发布于 2024-09-28 11:27:18 字数 265 浏览 0 评论 0原文

我在 wxPython 脚本中有一个简单的框架,但它并不像我希望的那样令人耳目一新。

基本上框架一开始是空白的。然后,用户可以选择不同的数据集以网格形式查看。选择数据集后,脚本会创建一个网格并将其放入框架中的大小调整器中。问题是框​​架以非常小的尺寸显示网格,大小调整器没有像它应该的那样扩展(或者至少是我期望的扩展)。此外,当我手动调整框架大小(即使用鼠标)时,大小调整器会像应有的那样突然扩展,并且整个框架都充满了网格。

如何让调整器立即扩展网格,而不仅仅是在手动调整框架大小时?

I have a simple frame in a wxPython script that isn't refreshing like I'd like it to.

Basically the frame starts out blank. The user can then select different datasets to view in a grid form. When the dataset has been chosen, the script creates a grid and puts it in a sizer in the frame. The problem is that the frame shows the grid in a very small size, the sizer isn't expanding like it should (or at least how I'd expect it to). Furthermore when I resize the frame manually (ie with the mouse) the sizer suddenly expands like it should, and the whole frame is filled with the grid.

How can I get the sizer to expand the grid right away, and not only when I resize the frame manually?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

杀お生予夺 2024-10-05 11:27:18

在包含网格的 sizer 上调用 Layout()

Call Layout() on the sizer containing the grid.

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