def get_square_view(self, center, distance): """ Attempt to return a view of a square centered on center. This might return a non-square rectangle if the center is near an edge. """ (center_x, center_y) = center (x1, x2) = self._adjust_coords(center_x, distance, self.width) (y1, y2) = self._adjust_coords(center_y, distance, self.height) return ga.GridView(self, x1, y1, x2, y2)
def get_row_view(self, row, left=None, right=None): """ Return a view of a single row It will be the whole row from the grid, unless left or right are passed. """ if left is None: left = 0 if right is None: right = self.width return ga.GridView(self, left, row, right, row + 1)
def get_col_view(self, col, low=None, high=None): """ Return a view of a single column. It will be the whole column from the grid, unless low or high are passed. """ if low is None: low = 0 if high is None: high = self.height return ga.GridView(self, col, low, col + 1, high)