Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:How to use tabs in PySymbian

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Tested with
Devices(s): Nokia N95, Nokia E90
Platform(s): S60 1st Edition, S60 2nd Edition, S60 3rd Edition
Keywords: appuifw
Created: lfd (18 Jul 2007)
Last edited: hamishwillee (31 May 2013)

This snippet shows how to use tabs in Python.


Source code

import appuifw, e32
#Create an active object
app_lock = e32.Ao_lock()
#Define the exit function
def quit():
app_lock.signal() = quit
#Define the tabs
tab1 = appuifw.Text(u"This is tab #1")
tab2 = appuifw.Text(u"This is tab #2")
tab3 = appuifw.Text(u"This is tab #3")
#Create a tab handler that switches between tabs
def handle_tab(index):
#Switch to the tab according to index
if(index==0): = tab1
if(index==1): = tab2
if(index==2): = tab3
##Set the tabs[u"One", u"Two", u"Three"], handle_tab)
#Set the default tab to the first tab, for example = tab1
#Wait for the user to request the exit


Tabs are displayed as appuifw.Text() objects and the user can switch between them by using the left and right navigation keys.



When running a script that implements tabs in the Script Shell, after the script execution returns the tabs are still visible. To avoid this, add this in the exit function, above the line that signals the active object:

#Remove tabs and their handler function[], None)
This page was last modified on 31 May 2013, at 01:09.
57 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.