diff --git a/locate2.py b/locate2.py index 0d4cd74..c417b5b 100644 --- a/locate2.py +++ b/locate2.py @@ -69,7 +69,8 @@ class Screen: get_cell_content = get_cell # For retro-compability class Pad(Screen): - def refresh(self, x=1, y=1, width=21, height=6, ask_for_input=True, endl="\n"): + def refresh(self, x=1, y=1, width=21, height=7, ask_for_input=True,\ + endl="\n", fancy=True): if width > self._width: width = self._width if height > self._height: @@ -88,13 +89,12 @@ class Pad(Screen): for dy in range(y, height+y): dy = dy for dx in range(x, width+x): - print(dx, dy) to_print += self._mat[dy][dx] to_print += "\n" to_print = to_print[:-1] - print(to_print) - if ask_for_input: - return input("> ") + print(to_print[:-width], end="") + if ask_for_input or fancy: + return input(to_print[-21:-1] if fancy else "> ") else: - print("", end=endl) + print(to_print[-21:], end=endl) return None