Python
  Home arrow Python arrow Page 3 - 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 - The Note Control
    ( Page 3 of 4 )

    Note is another control implemented as a dialog. It is used to display messages to the user. This is, again, one of the most common controls in the toolkit of PyS60. It can be used to display different messages. These messages can be anything from simple messages, such as information about the size of the current file or critical messages, such as low battery. The note function takes three arguments. They are text, type, and global. Of these, only text is a mandatory argument. The other two are optional. Here are the details.

    Text is the message to be shown. It is a Unicode string. For example, to show a message stating that the memory is full, the text argument will be in the following format:

    u”Memory is full”

    The u at the start indicates that it is a Unicode text.

    Now we'll discuss type. As stated earlier, the note function can be used to display different kinds of messages. The kind of message is determined by the value passed for ‘type’ parameter. This parameter can accept the following string values:

    • Info – is the default value, if no value is passed. When the type is set to info, the message shown will be simple. Hence, the icon will have ‘i’ as a symbol.
    • Error – to show error messages, one can use this string as the value. If the type is set to ‘error,’ the icon will have ‘e’ as the symbol.
    • Conf – set the type to ‘conf’ when the message to be shown is related to configuration. An example of configuration is selecting and setting the fonts. Once a font has been set, a message whose type is conf can be shown to the user informing him or her of the name of the new font.

    The global argument decides whether the note displayed is global or not. A global note is a note that will be displayed even if the application calling the note function is not in the foreground. The global argument takes an integer value. Any value other than zero is used to make a note or the displayed message global. The default value for this argument is zero. For example, to show a non-global message to the user, the value passed to the global argument will be:

    0

    For example, to display a global error message stating that the memory is full, the statement will be:

    note(u”Memory is full”, error, 1)

    That brings us to the end of the third section. The next section will be about building an application using what we've discussed in this article.



     
     
    >>> 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 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek