
__author__ = 'Olivier Larrieu'

from gtk import gdk


class ScreenProperties(object):
    """
     Usefull to get basic screen informations
    """

    @classmethod
    def screen_dimension(cls):
        """
            Return a dic with the screen height and screen width
        """
        width = gdk.screen_width()
        height = gdk.screen_height()
        return {'width': width, 'height': height}

__author__ = 'Olivier Larrieu'


class ScreenProperties(object):
    """
     Usefull to get basic screen informations
    """

    @classmethod
    def screen_dimension(cls):
        """
            Return a dic with the screen height and screen width
        """
        from Xlib import display
        display = display.Display()
        root = display.screen().root
        desktop = root.get_geometry()

        return {'width': desktop.width, 'height': desktop.height}
Use Xlib instead of gtk to get screen width and screen height This limit dependances
Use Xlib instead of gtk to get screen width and screen height
This limit dependances

  
  __author__ = 'Olivier Larrieu'
- 
- from gtk import gdk
  
  
  class ScreenProperties(object):
      """
       Usefull to get basic screen informations
      """
  
      @classmethod
      def screen_dimension(cls):
          """
              Return a dic with the screen height and screen width
          """
-         width = gdk.screen_width()
-         height = gdk.screen_height()
+         from Xlib import display
+         display = display.Display()
+         root = display.screen().root
+         desktop = root.get_geometry()
+ 
-         return {'width': width, 'height': height}
+         return {'width': desktop.width, 'height': desktop.height}
Use Xlib instead of gtk to get screen width and screen height This limit dependances
## Code Before:

__author__ = 'Olivier Larrieu'

from gtk import gdk


class ScreenProperties(object):
    """
     Usefull to get basic screen informations
    """

    @classmethod
    def screen_dimension(cls):
        """
            Return a dic with the screen height and screen width
        """
        width = gdk.screen_width()
        height = gdk.screen_height()
        return {'width': width, 'height': height}
## Instruction:
Use Xlib instead of gtk to get screen width and screen height This limit dependances
## Code After:

__author__ = 'Olivier Larrieu'


class ScreenProperties(object):
    """
     Usefull to get basic screen informations
    """

    @classmethod
    def screen_dimension(cls):
        """
            Return a dic with the screen height and screen width
        """
        from Xlib import display
        display = display.Display()
        root = display.screen().root
        desktop = root.get_geometry()

        return {'width': desktop.width, 'height': desktop.height}