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.

Archived:PySymbian Input and Output

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}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Article
Created: bogdan.galiceanu (17 Nov 2007)
Last edited: hamishwillee (31 May 2013)


This article describes the various ways of displaying and getting information in PySymbian using the appuifw module.

Contents

Input

Queries:

import appuifw
 
appuifw.query(u"Enter a word", "text")
#prompts for a string
 
appuifw.query(u"Enter a number", "number")
#prompts for an integer
 
appuifw.query(u"Enter a password", "code")
#prompts for a combination of numbers and letters, and shows them as "*" for protection
 
appuifw.query(u"Enter a time", "time")
#prompts for a time in hh:mm format
 
appuifw.query(u"Do you play golf?", "query")
#displays a question
 
appuifw.multi_query(u"Object1", u"Object2")
#prompts for two fields of information


Screenshots of the above items, in order:

Query1.JPG   Query2.JPG   Query3.JPG

Query4.JPG   Query5.JPG   Query6.JPG

Output

Notes:

import appuifw
 
appuifw.note(u"Good to have you back")
#displays a simple message
 
appuifw.note(u"File not found", "error")
#displays the message as a warning with appropriate sound
 
appuifw.note(u"Installation complete", "conf")
#displays the message as a confirmation with appropriate sound

Popup:

import appuifw
 
p=appuifw.InfoPopup()
 
p.show(u"Text goes here", (x, y), 5000, 0)
#Shows the popup containing the text at the coordinates x and y
#for 5000 milliseconds and with 0 milliseconds waited before it is displayed
 
p.hide() #Hides the popup immediately


Screenshots of the above items, in order:

Note1.JPG   Note2.JPG

Note3.JPG   Popup.JPG

Both

Popup menu:

import appuifw
 
appuifw.popup_menu([u"Option1", u"Option2"])
#displays a list of options in the shape of a menu

Selection list and multi selection list:

import appuifw
 
appuifw.selection_list([u"Option1", u"Option2"])
#displays a list of options
 
appuifw.multi_selection_list([u"Option1", u"Option2"], style='checkbox', search_field=1)
#displays a sort of checkbox list of options, with the index of the selected options returned as a tuple
#style can be 'checkmark' for the options to be ticked when selected; if search_field is 1, a search field is available


Screenshots for the above items, in order:

Popup menu.JPG   Selection list.JPG   Multi selection list.JPG


See also

Archived:How to use globalui

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

×