hey!<br><br>Following is a small PyS60 script. The error seems related to basic syntax - "state" in keys() is not recognized although defined globally.<br><br>Would appreciate assistance.<br><br>=============================================<br>
import appuifw, key_codes, e32, telephone<br>state = None<br><br>def keys(event):<br> if event['keycode'] == key_codes.EKeyYes:<br> appuifw.note(u"Doesn't Matter")<br> elif (event['keycode'] == key_codes.EKeyYes) and (state == telephone.EStatusConnected):<br>
appuifw.note(u"Yes was pressed and call active")<br><br>def cb_calling(args):<br> state = args[0]<br><br>def quit():<br> app_lock.signal()<br><br>telephone.call_state(cb_calling)<br>canvas = appuifw.Canvas(event_callback = keys)<br>
appuifw.app.body = canvas<br>appuifw.app.exit_key_handler = quit<br>app_lock = e32.Ao_lock()<br>app_lock.wait()<br>==============================================<br><br>Best,<br> wirefree<br>