Example 12: Application menu
import appuifw, e32def photo():
appuifw.note(u"Cheese!")
def darken():
appuifw.note(u"I can't see a thing!")
def lighten():
appuifw.note(u"My eyes are burning!")
def quit():
print "WANNABE PHOTOEDITOR EXITS"
app_lock.signal()
appuifw.app.exit_key_handler = quit
appuifw.app.title = u"PhotoEditor"
appuifw.app.menu = [(u"Take Photo", photo), (u"Edit photo",
((u"Darken", darken), (u"Lighten", lighten)))]
print "WANNABE PHOTOEDITOR STARTED"
app_lock = e32.Ao_lock()
app_lock.wait()
The application menu, appuifw.app.menu, is defined as a list that
consists of tuples. Each item in the list is of the form (u"Item name",
No comments:
Post a Comment