diff --git a/test_scripts/display_attr_lines_wiget.py b/test_scripts/display_attr_lines_wiget.py index b1d34f8..70d1dd0 100644 --- a/test_scripts/display_attr_lines_wiget.py +++ b/test_scripts/display_attr_lines_wiget.py @@ -33,6 +33,13 @@ class TestWidget(urwid.WidgetWrap): elif key == "down": self.lines.upper_offset -= 1 + def mouse_event(self, size, event, button, col, row, focus): + if event == "mouse press": + if button == 4: + self.lines.upper_offset += 1 + if button == 5: + self.lines.upper_offset -= 1 + def main(): screen = urwid.curses_display.Screen() palette = [ diff --git a/test_scripts/display_pressed_keys.py b/test_scripts/display_pressed_keys.py index 2bab122..f07da43 100644 --- a/test_scripts/display_pressed_keys.py +++ b/test_scripts/display_pressed_keys.py @@ -19,7 +19,7 @@ class TestWidget(urwid.WidgetWrap): self.text.set_text("\n".join(self.last_keys)) def mouse_event(self, size, event, button, col, row, focus): - self.last_keys.append(f"{size!r} {event!r} {button!r} ({row}, {col})") + self.last_keys.append(f"{event!r} {button!r} ({row}, {col})") self.last_keys = self.last_keys[-self.KEY_LIMIT:] self.text.set_text("\n".join(self.last_keys))