Namespaces
Variants
Actions
(Redirected from How to add a submenu)

Archived:How to add a submenu in PySymbian

Jump to: navigation, search
Archived.png
Aquivado: 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 (08 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 8 May 2013, at 08:12.
231 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved