wxPython:防止任务栏菜单在单击某个项目后关闭
我正在使用 wxPython 创建任务栏菜单。菜单包含一些菜单项(显然)。 现在,我想在单击特定项目时更新/更改其中一些项目,同时仍然显示菜单。
如何防止任务栏菜单在单击某个项目后消失? 我发现唯一有用的方法是 wxMenu.UpdateUI()
,但这并不能阻止菜单消失。
I am using wxPython to create a taskbar menu. The menu contains some menu items (obviously).
Now I would like to update/change some of these items when a particular item is clicked, while still displaying the menu.
How can I prevent the taskbar menu from disappearing after clicking an item?
The only method I've found that could be useful is wxMenu.UpdateUI()
, but that doesn't prevent the menu from disappearing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尽管我自己从未尝试过,但我记得尝试过使用弹出菜单和菜单来实现类似的效果。文本控件。您可能需要考虑尝试 wx.lib.agw .flatmenu.FlatMenuBar,它提供了一个事件处理程序OnMenuDismissed(self, event),以及其他一些事件处理程序,从名称来看,这些处理程序似乎是您想要的需要。您需要创建自己的 OnMenuDismissed() 并覆盖该事件。
Although I never got around to trying it myself, I remember attempting a similar effect with a popup menu & textctrl. You might want to consider trying wx.lib.agw.flatmenu.FlatMenuBar, it provides an event handler OnMenuDismissed(self, event), as well as a few others, which by name appear to be what you need. You would need to create your own OnMenuDismissed() and override the event.