parameters: (self, width=_CFG["width"], height=_CFG["height"],
                startx=_CFG["leftright"], starty=_CFG["topbottom"])
docstring: Set the size and position of the main window.
  
          Arguments:
          width: as integer a size in pixels, as float a fraction of the screen.
            Default is 50% of screen.
          height: as integer the height in pixels, as float a fraction of the
            screen. Default is 75% of screen.
          startx: if positive, starting position in pixels from the left
            edge of the screen, if negative from the right edge
            Default, startx=None is to center window horizontally.
          starty: if positive, starting position in pixels from the top
            edge of the screen, if negative from the bottom edge
            Default, starty=None is to center window vertically.
  
          Examples (for a Screen instance named screen):
          >>> screen.setup (width=200, height=200, startx=0, starty=0)
  
          sets window to 200x200 pixels, in upper left of screen
  
          >>> screen.setup(width=.75, height=0.5, startx=None, starty=None)
  
          sets window to 75% of screen by 50% of screen and centers
docstring_summary: Set the size and position of the main window.
docstring_tokens: Set the size and position of the main window .
function: def setup(self, width=_CFG["width"], height=_CFG["height"],
                startx=_CFG["leftright"], starty=_CFG["topbottom"]):
          """ Set the size and position of the main window.
  
          Arguments:
          width: as integer a size in pixels, as float a fraction of the screen.
            Default is 50% of screen.
          height: as integer the height in pixels, as float a fraction of the
            screen. Default is 75% of screen.
          startx: if positive, starting position in pixels from the left
            edge of the screen, if negative from the right edge
            Default, startx=None is to center window horizontally.
          starty: if positive, starting position in pixels from the top
            edge of the screen, if negative from the bottom edge
            Default, starty=None is to center window vertically.
  
          Examples (for a Screen instance named screen):
          >>> screen.setup (width=200, height=200, startx=0, starty=0)
  
          sets window to 200x200 pixels, in upper left of screen
  
          >>> screen.setup(width=.75, height=0.5, startx=None, starty=None)
  
          sets window to 75% of screen by 50% of screen and centers
          """
          if not hasattr(self._root, "set_geometry"):
              return
          sw = self._root.win_width()
          sh = self._root.win_height()
          if isinstance(width, float) and 0 <= width <= 1:
              width = sw*width
          if startx is None:
              startx = (sw - width) / 2
          if isinstance(height, float) and 0 <= height <= 1:
              height = sh*height
          if starty is None:
              starty = (sh - height) / 2
          self._root.set_geometry(width, height, startx, starty)
          self.update()
function_tokens: def setup ( self , width = _CFG [ "width" ] , height = _CFG [ "height" ] , startx = _CFG [ "leftright" ] , starty = _CFG [ "topbottom" ] ) : if not hasattr ( self . _root , "set_geometry" ) : return sw = self . _root . win_width ( ) sh = self . _root . win_height ( ) if isinstance ( width , float ) and 0 <= width <= 1 : width = sw * width if startx is None : startx = ( sw - width ) / 2 if isinstance ( height , float ) and 0 <= height <= 1 : height = sh * height if starty is None : starty = ( sh - height ) / 2 self . _root . set_geometry ( width , height , startx , starty ) self . update ( )