| ID | Creation date | July 16, 2008 | |
| Platform | S60 2nd Edition, S60 3rd Edition | Tested on devices | Nokia N96 |
| Category | Python | Subcategory | UI |
| Keywords (APIs, classes, methods, functions): appuifw, menu |
The following PyS60 code snippet will explain how to create a menu inside a menu. When you click an option in the main menu, there will again a new window with different options.
import appuifw,e32 #importing the necessary modules
def quit(): #define the exit event
print "Exit Key Pressed"
app_lock.signal()
# define functions for menu callbacks
def tst():
print u"hi"
def bst():
print u"bye"
def tata():
appuifw.app.title = u"Tata" # Change application title
appuifw.app.menu = [(u"yes",tst),(u"no",bst)]
appuifw.app.exit_key_handler = quit
def ford():
appuifw.app.title = u"Ford" # Change application title
appuifw.app.menu = [(u"one",tst),(u"two",bst)]
appuifw.app.exit_key_handler = quit
# main menu
appuifw.app.menu = [(u"Nano",tata),(u"Ikon",ford)]
# wait for exit
appuifw.app.exit_key_handler = quit
app_lock = e32.Ao_lock()
app_lock.wait()
No related wiki articles found