Dual Screen

  • Jochen Weiss

    Jochen Weiss - 2008-11-24

    Has anyone of you tried to write a small multi-head application ? Just something like typing a text in on screen 0 and display it in fullscreen on screen 1.

    If yes, can you provide the sample code ?

    • Martin Zibricky

      Martin Zibricky - 2008-11-24

      Speaking for myself, I haven't tried it yet. I wanted to do it but there are some other issues at the moment.

      I also would love to see any sample code ;-)

    • celsowm

      celsowm - 2008-11-24

      A good begin is:
      import sys,os
      from PyQt4.QtGui  import *
      from PyQt4.QtCore import *

      app = QApplication(sys.argv)

      desktop_widget = QDesktopWidget()
      num_screens = desktop_widget.numScreens()
      print num_screens

      • Martin Zibricky

        Martin Zibricky - 2008-11-24

        The class  'QDesktopWidget' is responsible for accessing screen information.


        I haven't the possibility to test dual screen, but this could work:

        import sys
        import os
        from PyQt4.QtGui import *
        from PyQt4.QtCore import *

        secondary_screen_id = 1

        app = QApplication(sys.argv)
        desktop_widget = QDesktopWidget()
        label = QLabel("Hello")

        geometry = desktop_widget.screenGeometry(secondary_screen_id)

        • Martin Zibricky

          Martin Zibricky - 2008-11-25

          This code works for me in winxp but it's a good idea to add these lines not to see only blinking on the second screen:

          to the imports:

          from time import sleep

          at the end:


    • Jochen Weiss

      Jochen Weiss - 2008-11-25

      Thanks for your quick answers.

      I hope to find some time during the next days to try this.
      I will post my results, when I was successful

    • Jochen Weiss

      Jochen Weiss - 2008-11-26

      Hey, it really works that way ;-)
      I only changed label.showMaximized() to label.showFullScreen ()

      Gonna write a small application with to screens to learn how you can use it for presentations :-)

      • Martin Zibricky

        Martin Zibricky - 2008-11-26

        When you are done with the small application, are you considering to commit that application into SVN?
        If yes, could you  use in svn directory, which I created?


        Could you, please, have a look at coding style recomendations?




Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks