'Set/get window size.'

def size(self, width=None, height=None):

    info = CONSOLE_SCREEN_BUFFER_INFO()
    status = self.GetConsoleScreenBufferInfo(self.hout, byref(info))
    if (not status):
        return None
    if ((width is not None) and (height is not None)):
        wmin = ((info.srWindow.Right - info.srWindow.Left) + 1)
        hmin = ((info.srWindow.Bottom - info.srWindow.Top) + 1)
        width = max(width, wmin)
        height = max(height, hmin)
        self.SetConsoleScreenBufferSize(self.hout, self.fixcoord(width, height))
    else:
        return (info.dwSize.X, info.dwSize.Y)
