mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-22 00:02:40 +00:00
Python: Rework the load_file API, part 1
Return a namespace that contains a "class type" for constructing the component instance - similar to the Node.js API.
This commit is contained in:
parent
d0fc025bc8
commit
280f314eeb
4 changed files with 28 additions and 3 deletions
|
@ -163,8 +163,9 @@ def test_callbacks():
|
|||
|
||||
if __name__ == "__main__":
|
||||
import slint
|
||||
instance = slint.load_file(
|
||||
module = slint.load_file(
|
||||
"../../examples/printerdemo/ui/printerdemo.slint")
|
||||
instance = module.MainWindow()
|
||||
instance.set_global_callback(
|
||||
"PrinterQueue", "start-job", lambda title: print(f"new print job {title}"))
|
||||
instance.run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue