Skip to content

Commit

Permalink
Update test_broadway.py
Browse files Browse the repository at this point in the history
  • Loading branch information
slaclau authored Jul 16, 2024
1 parent 97cfc3a commit 558643e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/demo/broadway/test_broadway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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}")
Expand All @@ -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")
Expand Down

0 comments on commit 558643e

Please sign in to comment.