当(取消)激活第二个监视器时 wx.Display_GetCount 不会更新
我有一个需要能够使用多个显示器的应用程序。监视器的参数显示在 wx.Choice 中,并通过在小部件上单击鼠标来更新它们。
问题是,当应用程序运行时,如果我拔掉第二个显示器(操作系统切换到单显示器模式),wx.Display_GetCount() 值在再次调用时不会改变。如果一开始只有一台显示器,然后连接第二台显示器,也会发生同样的情况 - 显示数量不会改变。
我想知道是否应该有 wx.Display 的更新方法,或者它只是无法“实时”更新。
我的操作系统:Windows 7 wxpython版本:2.8 蟒蛇:2.7
I have an application which needs to be able to use multiple monitors. The monitors' parameters are displayed in a wx.Choice and they are updated on mouse-click on the widget.
Problem is that while the app is running if I unplug the second monitor(the os switches to single monitor mode) the wx.Display_GetCount() value doesn't change when it's called again. The same thing happens if at start there is only one monitor and then a second one is attached - the display count would not change.
I wonder if there is supposed to be an update method for wx.Display or it just isn't capable of "live"-update.
My OS: Windows 7
wxpython version: 2.8
python: 2.7
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定这是否有帮助,但也许您可以尝试在应用程序中绑定 wx.EVT_DISPLAY_CHANGED 事件,然后再次调用 wx.Display.GetCount()。关于此事件的信息几乎不存在,而据我所知,当您再次调用 wx.Display.GetCount() 时,应该重建可用显示的列表,或者至少这是我的理解此处:
http://trac.wxwidgets.org/ticket/4582
如果这样如果没有发生,那么可能是 wxWidgets 中的一个错误。
安德里亚.
I am not sure this is going to help or not, but maybe you could try and bind the wx.EVT_DISPLAY_CHANGED event in your app and then call again wx.Display.GetCount(). The information out there about this event is pretty much non-existent, while as far as I can see wx.Display.GetCount() should rebuild the list of available displays when you call it again, or at least this is what I understood from here:
http://trac.wxwidgets.org/ticket/4582
If this doesn't happen, then maybe it's a bug in wxWidgets.
Andrea.