def screenRegion(gfx, region=(0.0, 0.0, 1.0, 1.0)):
    """(gfx, 4-tuple of floats) -> (4-tuple of ints)
    Determine the absolute coordinates of a screen region from its
    relative coordinates (coordinates from 0.0 to 1.0)
    """
    w, h = gfx.getSize()
    x1 = (w - 1) * region[0]
    y1 = (h - 1) * region[1]
    x2 = (w - 1) * region[2]
    y2 = (h - 1) * region[3]
    if type(w) == type(1):
        x1 = int(x1 + 0.5)
        y1 = int(y1 + 0.5)
        x2 = int(x2 + 0.5)
        y2 = int(y2 + 0.5)
    return (x1, y1, x2, y2)