Script skeleton

Description:

The following example shows a skeleton of a simple script.

######  import all modules needed
import appuifw
import e32
###### set the screen size (in this example, to large)
appuifw.app.screen='large'
###### create a menu and the callback functions for it
def function_A():
    print "function_A"
def function_B():
    print "function_B"
def function_C():
    print "function_C"
appuifw.app.menu = [(u"Function A", function_A),(u"Function B", function_B),(u"Function C", function_C)]
##### create and set an exit key handler
def exit_key_handler():
    app_lock.signal()
    appuifw.app.set_exit()
##### set the title
appuifw.app.title = u"New Title"
#####
app_lock = e32.Ao_lock()
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()

Download:

skeleton.py

Department of Electronic Systems | Aalborg University | Niels Jernes Vej 12 | DK-9220 Aalborg | Denmark
Phone: (+45) 9635 8695 | Fax (+45) 9815 1583 | E-mail ies(at)ies.aau.dk
Copyright © 2006 Department of Electronic Systems

Last update:03-10-2006