diff --git a/test/demo/broadway/test_broadway.py b/test/demo/broadway/test_broadway.py index 3aebab8..20c612a 100644 --- a/test/demo/broadway/test_broadway.py +++ b/test/demo/broadway/test_broadway.py @@ -50,11 +50,9 @@ def main(demo, browser): directory = (pathlib.Path(__file__).parent / "results").resolve() plot = PlotlyGtk(fig) plot.set_size_request(800, 600) - webview = FigureWebView(fig) - webview.set_hexpand(True) - webview.set_vexpand(True) + paned = Gtk.Paned(orientation=Gtk.Orientation.HORIZONTAL) - paned.set_start_child(webview) + paned.set_end_child(plot) window.set_content(paned) window.maximize() @@ -64,6 +62,10 @@ def main(demo, browser): def run_test(): print("run_test") if browser is not None: + webview = FigureWebView(fig) + webview.set_hexpand(True) + webview.set_vexpand(True) + paned.set_start_child(webview) browser.get("http://127.0.0.1:8085/") time.sleep(5) print(f"Got {demo}") @@ -77,8 +79,9 @@ def run_test(): time.sleep(10) window.close() - GLib.idle_add(run_test) - + thread = threading.Thresd(daemon=True, target=run_test) + thread.start() + thread.join() def run_demo(demo, browser=None): app = Adw.Application(application_id="io.github.slaclau.plotly_gtk.test")