Multi-Monitor Support

M

Mark rainess

Hello,


Does Python or wxPython include any support for multiple monitors. In my
application multiple monitors are located at a distance. It is not
convenient to move a window from the main monitor to one of the others.
I want to have the option to open an an application on any connected
monitor. I am using wxPython. Does anyone know how to do it?

Thanks

Mark Rainess
 
J

Jesse Hager

Mark said:
Hello,


Does Python or wxPython include any support for multiple monitors. In my
application multiple monitors are located at a distance. It is not
convenient to move a window from the main monitor to one of the others.
I want to have the option to open an an application on any connected
monitor. I am using wxPython. Does anyone know how to do it?

Thanks

Mark Rainess

import wx

app = wx.App()

#To get the count of displays
num_displays = wx.Display.GetCount()

#Open a frame on each display
for display_num in range(num_displays):
#Get a display object
display = wx.Display(display_num)

#To get a wx.Rect that gives the geometry of a display
geometry = display.GetGeometry()

#Create a frame on the display
frame = wx.Frame(None,-1,"Display %d"%display_num,
geometry.GetTopLeft(),geometry.GetSize())

#Make the frame visible
frame.Show()

app.MainLoop()

Creating a window on a different display is the same as creating one on
the main display, all you need to do is specify coordinates somewhere on
the alternate display when calling the constructor.

Use wx.Display to find out about the displays on the system, it also
lets you query and set the current video mode for a display.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top