Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Revision as of 01:08, 31 May 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Archived:How to add a submenu in PySymbian

From Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

Acredita-se que este artigo ainda seja válido no contexto original (quando ele foi escrito)


Article Metadata
Tested with
Devices(s): Nokia N96
Compatibility
Platform(s): S60 2nd Edition, S60 3rd Edition
Platform Security
Capabilities: )
Article
Keywords: appuifw, menu
Created: cyke64 (15 Mar 2007)
Last edited: hamishwillee (31 May 2013)

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

This page was last modified on 31 May 2013, at 01:08.
68 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.

×