From d0fd20b26b0c9740247e9e4b6dbba46eae2f275c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Wed, 2 Jun 2021 18:44:00 +0100 Subject: [PATCH] examples/simple: fix constructor and run method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe LaĆ­ns --- rich/tui/examples/simple.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/rich/tui/examples/simple.py b/rich/tui/examples/simple.py index 88a01d3452..7c8b9cdf69 100644 --- a/rich/tui/examples/simple.py +++ b/rich/tui/examples/simple.py @@ -1,6 +1,8 @@ +from rich.console import Console from rich.layout import Layout from rich.table import Table from rich.tui.app import App +from rich.tui.view import View from rich.widgets.color_changer import ColorChanger @@ -8,8 +10,13 @@ class SimpleApp(App): table: Table - def __init__(self): - super().__init__() + def __init__( + self, + console: Console = None, + view: View = None, + screen: bool = True, + ): + super().__init__(console, view, screen, title='Simple App') self.table = table = Table("foo", "bar", "baz") table.add_row("1", "2", "3") @@ -25,4 +32,4 @@ def visualize(self): if __name__ == "__main__": app = SimpleApp() - app.run_message_loop() + app.run()