add property setters in event class

use event property setters in examples

update README

patch bump
This commit is contained in:
onyx-and-iris
2022-10-06 16:45:08 +01:00
parent 08fdad135d
commit 86612a65cb
5 changed files with 47 additions and 19 deletions

View File

@@ -605,20 +605,30 @@ The following methods are available:
example:
```python
# register the app self as an event observer
self.vm.subject.add(self)
# register an app to receive updates
class App():
def __init__(self, vm):
vm.subject.add(self)
...
```
#### `vm.event`
You may also add/remove event subscriptions as necessary with the Event class.
Use the event class to toggle updates as necessary.
The following properties are available:
- `pdirty`: boolean
- `mdirty`: boolean
- `midi`: boolean
- `ldirty`: boolean
example:
```python
vm.event.add("ldirty")
vm.event.ldirty = True
vm.event.remove("pdirty")
vm.event.pdirty = False
# get a list of currently subscribed
print(vm.event.get())