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. Thanks for all your past and future contributions.

Archived:Using TopWindow in PySymbian

From Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Tested with
Devices(s): Nokia N95, Nokia E90
Platform(s): S60 1st Edition, S60 2nd Edition, S60 3rd Edition
Keywords: topwindow
Created: Jan Rune Johansen (16 Aug 2007)
Last edited: hamishwillee (31 May 2013)



This snippet shows how to use TopWindow class from the topwindow module to show a window on top of other applications in Python.


Display sizes may vary from one device to another. Available sizes can be found by using the display_pixels() function of the sysinfo module.

Source code

import appuifw, e32, graphics, topwindow
app_lock = e32.Ao_lock()
#Define the exit function
def quit():
#Hide the window
app_lock.signal() = quit
#Create an instance of TopWindow
window = topwindow.TopWindow()
#Set its size
window.size = (210, 160)
#Set the position of it upper left corner
window.position = (10, 40)
#Create a new, red image to display
img =, 110))
#Write text on it
img.text((25, 25), u"This is a pop-up", font = 'title')
#Add it to the window specifying coordinates for its upper left corner
window.add_image(img, (10, 10))
#Make the window's background green
window.background_color = 0x00FF00
#Add a shadow effect
window.shadow = 4
#Make the corners round
window.corner_type = 'corner5'
#Display the window
#Wait for the user to request the exit


A pop-up window containing the specified image and other elements is shown on top of the application that is currently in the foreground.


Additional information

A TopWindow object also has the visible attribute which can be read in order to determine whether the object is visible, or written (1 for visible, 0 for invisible).

This page was last modified on 31 May 2013, at 01:10.
57 page views in the last 30 days.