Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 22:30, 9 July 2007.

How to create a simple Python listbox

From Forum Nokia Wiki

It doesn't get much simpler than this. List box with two elements linking to two handlers.

import e32
import appuifw
 
choices =[(u"Option1Text", "option1action"),
          (u"Option2Test", "option2action")]
choices_labels = [x[0] for x in choices]
 
   
def handle_selection():
    index = lb.current()
    code = choices[index][1]
    lb.set_list([u"Please wait..."])
    if code == "option1action":
        appuifw.note(u"here is where we process option1", 'info')
       
        
    elif code == "option2action":
        appuifw.note(u"here is where we process option2", 'info')
    else:
        appuifw.note(u"no valide code detected", 'error')
    lb.set_list(choices_labels)
 
def handle_add():
    pass  
 
def handle_delete():
    pass
 
def exit_key_handler():
    app_lock.signal()
 
lb = appuifw.Listbox(choices_labels, handle_selection)
 
old_title = appuifw.app.title
appuifw.app.title = u"Listbox UI"
appuifw.app.body = lb
appuifw.app.menu = [(u"Add new item", handle_add),
                    (u"Delete item", handle_delete)]
appuifw.app.exit_key_handler = exit_key_handler
 
app_lock = e32.Ao_lock()
app_lock.wait()
 
appuifw.app.title = old_title
Related Discussions
Thread Thread Starter Forum Replies Last Post
Listbox graphics sbardill Symbian User Interface 2 2003-04-03 13:18
difference btw listbox and grid fjorge_ht General Symbian C++ 0 2005-07-01 15:46
ListBox Font kingkiko General Symbian C++ 1 2006-09-14 01:08
Problem running small standonline python app ninjaj Python 1 2007-06-17 19:19
Python for S60 1.4.4 released but again based upon backdated Python 2.2.2 arifulbd Python 6 2008-08-11 18:32
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZpythonQ
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX