mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
Python: Fix Slint file loading in callback examples
The foo_slint import has been replaced with the auto-loader.
This commit is contained in:
parent
7859d69339
commit
833883b028
1 changed files with 2 additions and 4 deletions
|
@ -185,9 +185,8 @@ The callbacks in Slint are exposed as properties and that can be called as a fun
|
|||
|
||||
```python
|
||||
import slint
|
||||
import MyComponent from my_component_slint
|
||||
|
||||
component = MyComponent()
|
||||
component = slint.loader.my_component.MyComponent()
|
||||
# connect to a callback
|
||||
|
||||
def clicked():
|
||||
|
@ -202,9 +201,8 @@ Another way to set callbacks is to sub-class and use the `@slint.callback` decor
|
|||
|
||||
```python
|
||||
import slint
|
||||
import my_component_slint
|
||||
|
||||
class Component(my_component_slint.MyComponent):
|
||||
class Component(slint.loader.my_component.MyComponent):
|
||||
@slint.callback
|
||||
def clicked(self):
|
||||
print("hello")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue