在wxpython中正确退出自定义模式对话框

发布于 2025-01-03 11:01:11 字数 199 浏览 5 评论 0原文

我的应用程序有一个自定义对话框,使用户能够设置创建新文档的选项。主窗口有一个工具栏,即使关闭对话框后,工具栏按钮也不会返回到活动状态。我见过 if fileDialog.ShowModal() == wx.ID_OK: 获取返回值,但是还有其他东西可以再次启用按钮吗?仅发送 dialog.Destroy() 似乎并不能做到这一点。

My application has a custom dialog box that enables the user to set options on creating a new document. The main window has a toolbar, and even after dismissing the dialog, the toolbar buttons don't return to an active state. I've seen if fileDialog.ShowModal() == wx.ID_OK:
to get the return value, but is there something else that enables the buttons again? Just sending dialog.Destroy() doesn't seem to do it.

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

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

发布评论

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

评论(1

丶视觉 2025-01-10 11:01:11

好吧,如果您打开了一个“fileDialog”和一个“dialog”对象,那么您可能需要销毁它们。如果将工具栏按钮设置为禁用状态,则您需要在关闭对话框后启用它们。

Well, if you have a "fileDialog" and a "dialog" object open, then you probably need to Destroy them both. If you set the toolbar buttons into a Disabled state, you'll want to Enable them after you dismiss the dialogs.

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