| Reply | « Previous Thread | Next Thread » |
|
Hi folks,
I made a small but handy update to the dialog module. For those who don't know, dialog is a library containing two C++ wrapper for the Wait and the Progress dialogs. You can now give a call back function to Wait that will be called if you press the Cancel button. Code:
import e32, appuifw
from dialog import Wait, Progress
appuifw.app.title= u'Hello dialog'
## Cancel callback
def cancel_cb():
print "cancel callback!!!"
# Wait(label=u'', [True/False, cancel_cb])
dlg = Wait(u"Hello Wait note :)", True, cancel_cb )
dlg.show()
print "Show"
e32.ao_sleep(2)
dlg.show()
dlg.set_label(u'Wait! Don\'t go :\'(')
print "Change label"
e32.ao_sleep(1)
dlg.close()
print "Wait, that's not finished!"
e32.ao_sleep(2)
dlg.show(u'Me again ;)')
e32.ao_sleep(2)
dlg.close()
e32.ao_sleep(2)
dlg.show()
print "Show again with the last label"
e32.ao_sleep(2)
dlg.close()
![]() I'll take care of that later in late September if nobody propose a fix before. You can get the module as well as some other in my download section http://lfdm.net/thesis/index.php/dlm/ If any problems with the installation packages let me know. I have so far tested successfully the updated module on N93 and 3rd edition emulator. Cheers, LFD Devices: Nokia E61 3rd Edition - pys60 1.4.0 Tips and modules: http://www.lfdm.net/thesis |
|
Hello ,
Test the new dialog (only the Wait part ) because the progress is awfull unfortunately with the new option !Code:
import e32, appuifw
from dialog import Wait
from e32 import ao_sleep as sleep
appuifw.app.title= u'Hello dialog'
def cancel_cb():
print "cancel callback !"
def end_script():
script_lock.signal()
def wait(glob,called):
if called:
dlg = Wait(u"Hello Wait note :)", glob , cancel_cb )
else:
dlg = Wait(u"Hello Wait note :)", glob )
dlg.show()
print "Show"
sleep(3)
dlg.show()
dlg.set_label(u'Wait! Don\'t go :\'(')
print "Change label"
sleep(2)
dlg.close()
print "Wait, that's not finished!"
sleep(3)
dlg.show(u'Me again ;)')
sleep(3)
dlg.close()
sleep(3)
dlg.show()
print "Show again with the last label"
sleep(2)
dlg.close()
print "that's finished !"
script_lock=e32.Ao_lock()
appuifw.app.menu=[(u'Wait ', lambda : wait(0,0)),(u'Wait with cancel key', lambda : wait(1,0)),(u'Wait with cancel key callback', lambda : wait(1,1)),(u'Exit', end_script)]
appuifw.app.exit_key_handler = end_script
script_lock.wait()
feedback : all features seems to work without any errors when you quit the app with exit option it returns to Python menu but ... when you quit Python it displays : "Application closed: Python KERN-EXEC 3" So not so perfect yet ;-) Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
Quote:
Result: everything works fine So I don't really know how to reproduce it ![]() I got "Python KERN-EXEC 3" panic code at the beginning when trying to code the callback even if the function pointer existed. The fix was to surround the callback call with : Code:
PyEval_RestoreThread(PYTHON_TLS->thread_state);
app_callback_handler( iCancelCallback );
PyEval_SaveThread();
![]() LFD Devices: Nokia E61 3rd Edition - pys60 1.4.0 Tips and modules: http://www.lfdm.net/thesis |
|
I really would like to use your fine component, but I don't know how to deploy it. I fear a bit the 1st, 2nd, 3rd chaos... and I wouldn't like to ask my users to download the component before.
What are the possibilities to overcome this? |
| neil.young |
| View Public Profile |
| Find all posts by neil.young |
|
Hi neil.young,
If you deploy installation packages (.sis, .sisx) you just add the library installation package in your application one, like you would do with PyS60 for example. LFD Devices: Nokia E61 3rd Edition - pys60 1.4.0 Tips and modules: http://www.lfdm.net/thesis |
|
That's possible? I didn't know that. Is the "forgeign" SIS called automatically than?
Regards |
| neil.young |
| View Public Profile |
| Find all posts by neil.young |
|
dlg = Wait(u"Hello Wait note
", True, cancel_cb )dlg.show() After printing out "cancel callback" Python still crashes on N70. And - if the script runs into a "processor intensive part" (e.g. urllib things), the dialog never pops up. Too bad. Regards |
| neil.young |
| View Public Profile |
| Find all posts by neil.young |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| [announce] wait dialog wrapper 0.2 | lfd | Python | 10 | 2008-03-21 12:03 |
| How do I glue a Dialog box to a CCoeControl Object? | loginssuck | General Symbian C++ | 1 | 2006-10-23 15:24 |
| unmodal dialog... | GeKI | Symbian User Interface | 0 | 2005-10-24 13:02 |
| [announce] cfgform - show configuration dialog form which is build from python dict | simo.salminen | Python | 0 | 2005-10-22 13:34 |
| createImage on Nokia Series 40 MIDP Concept SDK Beta 0.3 | GerardMason | Mobile Java Media (Graphics & Sounds) | 2 | 2003-09-30 11:00 |