×
Namespaces

Variants
Actions
Revision as of 23:01, 25 September 2009 by fasttrack (Talk | contribs)

Archived:How to add a submenu in PySymbian

From Nokia Developer Wiki
Jump to: navigation, search
{{{width}}}


Article Metadata
Tested with
Devices(s): Nokia N96
Compatibility
Platform(s): S60 2nd Edition, S60 3rd Edition
Article
Keywords: appuifw, menu
Created: (15 Mar 2007)
Last edited: fasttrack (25 Sep 2009)

Overview

Python can use submenu in menu options but it can be difficult to remember how to use them !

  • Item 1
  • Submenu
    • Item 2
    • Item 3

Identation has been used for a better understanding. Don't mismatch the parentheses ! Item2 and item3 will be displayed on screen only when you click on submenu.

Code

#import module
import appuifw
# create menu
appuifw.app.menu = [(u"item 1", item1_cb),
(u"Submenu", (
(u"sub item 2", subitem2_cb),
(u"sub item 3", subitem3_cb)
)
)
]
# item1_cb, subitem2_cb, subitem3_cb are callback

Postconditions

Here is a screenshot to illustrate this submenu.

SubMenu Items















Related Links

65 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×