Python
  Home arrow Python arrow Page 3 - Mobile Programming in Python using PyS...
CIO Insight
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
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? 
PYTHON

Mobile Programming in Python using PyS60: UI Controls
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    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:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    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


       · In this discussion I have explained about the basic UI controls supported by...
     

       

    PYTHON ARTICLES

    - SSH with Twisted
    - Mobile Programming in Python using PyS60: UI...
    - Python: Count on It
    - Python Strings: Spinning Yarns
    - Python: More Fun with Strings
    - Python: Stringing You Along
    - Python Operators
    - Bluetooth Programming in Python: Network Pro...
    - Python Sets
    - Python Conditionals, Lists, Dictionaries, an...
    - Python: Input and Variables
    - Introduction to Python Programming
    - Mobile Programming in Python using PyS60: Ge...
    - Bluetooth Programming using Python
    - Finishing the PyMailGUI Client: User Help To...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway