Multi-Monitor Support

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark rainess

    #1

    Multi-Monitor Support

    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
  • Jesse Hager

    #2
    Re: Multi-Monitor Support

    Mark rainess wrote:[color=blue]
    > 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[/color]

    import wx

    app = wx.App()

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

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

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

    #Create a frame on the display
    frame = wx.Frame(None,-1,"Display %d"%display_num ,
    geometry.GetTop Left(),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.

    --
    Jesse Hager
    email = "wrffruntre@tzn vy.pbz".decode( "rot13")

    Comment

    Working...