Python
  Home arrow Python arrow Page 2 - Mobile Programming in Python using PyS60: UI Controls
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PYTHON

Mobile Programming in Python using PyS60: UI Controls
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 2
    2008-02-27


    Table of Contents:
  • Mobile Programming in Python using PyS60: UI Controls
  • UI Controls: Query and Notes
  • The Note Control
  • PyS60 in Real World

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Mobile Programming in Python using PyS60: UI Controls - UI Controls: Query and Notes
    ( Page 2 of 4 )

    Query and Notes controls are the most commonly used of all the controls. They are used to take input and display messages. Here are the details:

    Query is a dialog type. It is used to gather input from the user. It presents a single line text box with a label to the user. Since query is a dialog, it is also implemented as a function. There are three parameters to the function. They are label, type, and initial value. The first two are mandatory parameters, whereas the third is optional. Here are the details:

    The label is the question or prompt that is shown to the user when the dialog box is displayed. The value for this argument is a Unicode string. For example, to show “Enter name” as the prompt, one will use the following as the value of the argument:

    U”Enter name”

    Type can be compared with the standard input dialog box that is common on the PC. Since it is a dialog, it can be of different dialog types. The type is decided by the type parameter of the query function. The different types are:

    • Text – is a simple text. The text is of Unicode type.
    • Code 
    • Number – in this case, the input box will accept only numbers and not decimals.
    • Date – the input is just a date. 
    • Time – to take time as input, the type needs to be set to time.
    • Float – to accept only decimals, this type can be used.


    All of these are string values. For example, to set the type to number, the value passed will be:

    number’

    The initial value is an optional parameter. It sets the initial value shown to the user. However, for the type float, setting this value does not have any effect. For text fields (i.e. the type having the value of either ‘text’ or ‘code’), the value for this argument is Unicode. If the type is ‘number,’ the value that can be passed is a numeric value only. If the type is date, then the initial value will be seconds, since an epoch is rounded to the nearest local midnight. For example, to set the initial value to 3, the value passed will be:

    3

    The return value of the query is the value provided by the user and the type of the input box. Therefore, to display a query with “Enter any number between 1 and 9” as a message, with number as the only acceptable data type and 0 as the initial value, the statement will be:

    guess=query(u“Enter any number between 1 and 9”, ‘number’,0)

    This is the end of the second section. In the next section, we will discuss the note control.



     
     
    >>> More Python Articles          >>> More By A.P.Rajshekhar
     

       

    PYTHON ARTICLES

    - Tuples and Other Python Object Types
    - The Dictionary Python Object Type
    - String and List Python Object Types
    - Introducing Python Object Types
    - Mobile Programming using PyS60: Advanced UI ...
    - Nested Functions in Python
    - Python Parameters, Functions and Arguments
    - Python Statements and Functions
    - Statements and Iterators in Python
    - Sequences and Sets in Python
    - Python Expressions and Operators
    - Dictionaries, Variables and Statements in Py...
    - Data Types in Python
    - The Python Language
    - SSH with Twisted





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek