Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

Using foreground image

You can draw directly to the phone screen.
It is useful for a notification from a background program.
You need to install fgimage.pyd from here.
import fgimage, e32

img = Image.new((100, 16))  # create a notification text
img.text((0, 14), u'Hello world', 0)

fg = fgimage.FGImage()
x, y = 0, 40           # position to draw
fg.set(x, y, img._bitmapapi())  # send it

e32.ao_sleep(1)
fg.unset()                # then clear it


See (a bit) more discussion here.

Switch application to foreground in pys60

Taken from the 'appswitch' module here
import appswitch
print appswitch.switch_to_fg(u"Menu")

Updated (19 Oct 05)
==================
Now it can
- listing running applications
- switching them to foreground/background
- closing/killing apps
# listing
apps = appswitch.application_list(True) # true = include all
                                       # false = no hidden apps 
print apps

# to background and closing
print appswitch.switch_to_bg(u"TODO")
print appswitch.end_app(u"TODO")

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS