Info: Other appuifw.app attributes: Tabs , Forms


Tabs: appuifw.app.set_tabs(tabnames, callback)

Tabs are used to switch application pages. Here is in short how to build tabs:

# define application 1: text app
    app1 = appuifw.Text(u'Appliation o-n-e is on')


# define application 2: text app
    app2 = appuifw.Text(u'Appliation t-w-o is on')


# define application 3: text app
    app3 = appuifw.Text(u'Appliation t-h-r-e-e is on')

def exit_key_handler():
    app_lock.signal()

# create a tab handler that switches the application based on what tab is selected
def handle_tab(index):
    global lb
    if index == 0:
        appuifw.app.body = app1 # switch to application 1
    if index == 1:
        appuifw.app.body = app2 # switch to application 2
    if index == 2:
        appuifw.app.body = app3 # switch to application 3

# create the tabs with its names in unicode as a list, include the tab handler
appuifw.app.set_tabs([u"One", u"Two", u"Three"],handle_tab)


# Example script 1: app_tabs_simple.py

# Example script 2: app_tabs_advanced.py

Tab 1 :

Tab 2:

Tab 3:

 

 

 

Forms: appuifw.app.form()


# define the content list (consists of tuples: (label, type ,value)); label is a unicode string
# type is one of the following strings: 'text', 'number', 'date', 'time',or 'combo'

# create a list to be used in 'combo' selection mode
model = [u'6600', u'6630', u'7610', u'N90', u'N70']


data = [(u'Mobile','text', u'Nokia'),(u'Model','combo', (model,0)),(u'Amount','number', 5), (u'Date','date'), (u'Time','time')]

# set the view/edit mode of the form
flags = appuifw.FFormEditModeOnly

# creates the form
f = appuifw.Form(data, flags)

# make the form visible on the UI
f.execute()

# for more parameters see the Nokia API_Reference_for_python document!

# Example script: form.py

 

 

 

Previous|Next  | Menu        Copyright (c) 2006 Jurgen Scheible