Using v8.01
def pwr_cb(event):
print('poewring off')
print('call back loaded')
# lv.event_send(pwr_cb, lv.EVENT.CLICKED, None)
The lv.event_send(pwr_cb, lv.EVENT.CLICKED, None)
can be copy and paste into the prompt >
Using v8.01
def pwr_cb(event):
print('poewring off')
print('call back loaded')
# lv.event_send(pwr_cb, lv.EVENT.CLICKED, None)
The lv.event_send(pwr_cb, lv.EVENT.CLICKED, None)
can be copy and paste into the prompt >
You should send events to objects, not functions.
simulator link…
https://sim.lvgl.io/v8.1/micropython/ports/javascript/index.html?script_direct=42e99fd157804858ce5aba4a4c290d42e1bb898d
It returns lv.RES.OK
, or lv.RES.INV
if the object was deleted in the event.
As I mentioned above - you should send events to objects, not functions.
Here is your fixed script.