From e4785220ef6838e25d8b09aa33bb8bf9ad2ce16e Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 14 Dec 2023 00:23:44 +0100 Subject: [PATCH] Add a little test for manual trying :) --- api/python/tests/test_instance.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/python/tests/test_instance.py b/api/python/tests/test_instance.py index 41ed7aa64..a69e5a168 100644 --- a/api/python/tests/test_instance.py +++ b/api/python/tests/test_instance.py @@ -110,3 +110,11 @@ def test_callbacks(): instance.set_callback("void-callback", lambda : None) instance.invoke("void-callback") + + +if __name__ == "__main__": + compiler = slint.ComponentCompiler() + compdef = compiler.build_from_path("../../examples/printerdemo/ui/printerdemo.slint") + instance = compdef.create() + instance.set_global_callback("PrinterQueue", "start-job", lambda title: print(f"new print job {title}")) + instance.run()