如何在wxpython中选择默认的wx.Display?
有没有办法选择某个 wx.Frame 应该显示在哪个屏幕上呢?
1 个回答
3
我觉得你不能改变默认的显示方式,不过这个代码片段可以在每个显示屏上创建一个框架。
import wx
def set_frame_display(frame, display_index):
display = wx.Display(display_index)
x, y, w, h = display.GetGeometry()
frame.SetPosition((x, y))
def main():
app = wx.PySimpleApp()
count = wx.Display_GetCount()
for index in range(count):
frame = wx.Frame(None, -1, 'Display %d of %d' % (index + 1, count))
set_frame_display(frame, index)
frame.Center()
frame.Show()
app.MainLoop()
if __name__ == '__main__':
main()