×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Super Contributor
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622

    [announce] dialog 0.3

    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

  2. #2
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: [announce] dialog 0.3

    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 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  3. #3
    Super Contributor
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622

    Re: [announce] 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 ;-)
    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

  4. #4
    Registered User
    Join Date
    Nov 2006
    Posts
    568

    Re: [announce] dialog 0.3

    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?

  5. #5
    Super Contributor
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622

    Re: [announce] dialog 0.3

    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

  6. #6
    Registered User
    Join Date
    Nov 2006
    Posts
    568

    Re: [announce] dialog 0.3

    That's possible? I didn't know that. Is the "forgeign" SIS called automatically than?

    Regards

  7. #7
    Registered User
    Join Date
    Nov 2006
    Posts
    568

    Re: [announce] dialog 0.3

    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

Similar Threads

  1. [announce] wait dialog wrapper 0.2
    By lfd in forum Symbian
    Replies: 10
    Last Post: 2008-03-21, 11:03
  2. Replies: 1
    Last Post: 2006-10-23, 14:24
  3. unmodal dialog...
    By GeKI in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-10-24, 12:02
  4. Replies: 0
    Last Post: 2005-10-22, 12:34
  5. createImage on Nokia Series 40 MIDP Concept SDK Beta 0.3
    By GerardMason in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2003-09-30, 10:00

Posting Permissions

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