You Are Here:

Community: Developer Discussion Boards

#1 Old [announce] dialog 0.3 - 2007-08-16, 12:58

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
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()
Progress is still amazingly bugged so there's no need to mention it for now, I already have some amazing crash tests

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
Reply With Quote

#2 Old Re: [announce] dialog 0.3 - 2007-08-16, 14:32

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
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()
Tested with N95 and PyS60 1.4 and dialog 0.3
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/
Reply With Quote

#3 Old Re: [announce] dialog 0.3 - 2007-08-16, 15:43

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Quote:
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 ;-)
I just tested your script and mine on:
  • N90
  • N93
  • E61
  • 3rd edition emulator

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();
If you have time you could try to add it to the Wait destructor and let me know if it fixes the issue

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#4 Old Re: [announce] dialog 0.3 - 2007-08-16, 23:57

Join Date: Nov 2006
Posts: 501
neil.young
Offline
Super Contributor
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?
Reply With Quote

#5 Old Re: [announce] dialog 0.3 - 2007-08-17, 09:34

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
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
Reply With Quote

#6 Old Re: [announce] dialog 0.3 - 2007-08-17, 10:34

Join Date: Nov 2006
Posts: 501
neil.young
Offline
Super Contributor
That's possible? I didn't know that. Is the "forgeign" SIS called automatically than?

Regards
Reply With Quote

#7 Old Re: [announce] dialog 0.3 - 2007-08-19, 00:18

Join Date: Nov 2006
Posts: 501
neil.young
Offline
Super Contributor
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
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ