Hi I have a nokia 5800 phone on which I was doing some pys60 ui programming. I used the below code to create the arrow. In short the draw() will draw the arrow onto the canvas surface. The canvas has redraw_callback and resize_callback hooked up to call draw() eventually. But on tilting I get some random text (garbage) output on the screen.
import appuifw
from appuifw import *
import e32
from graphics import *
def up(dummy):
appuifw.note(u'Button 1 Clicked', 'note')
def down(dummy):
appuifw.note(u'Button 2 Clicked', 'note')
appuifw.app.screen = 'normal'
def on_resize(dummy):
draw()
def on_redraw(dummy):
draw()
def on_exit():
global lock
lock.signal()
def draw():
global canvas
canvas.clear()
canvas.polygon((20,20,20,60,40,40,20,20), fill=(255,0,0), width=10)
canvas = appuifw.Canvas(resize_callback=on_resize, redraw_callback=on_redraw)
lock = e32.Ao_lock()
appuifw.exit_key_handler = on_exit
draw()
lock.wait()
Here is how it looks when I've held the phone straight up.
Here is how it looks when I've tilted it.