| Reply | « Previous Thread | Next Thread » |
|
Code:
import key_codes, appuifw, e32, graphics
POINT_SIZE = 10
POINT_COLOR = (0, 0, 255) #Plava
MOVE = 1
def handle_redraw(rect):
global Loc_X, Loc_Y
Loc_X = 10
Loc_Y = 10
panel.clear((0,0,0))
panel.point((Loc_X, Loc_Y), width=POINT_SIZE, fill=POINT_COLOR)
canvas.blit(panel)
def handle_events(event):
if event['keycode'] == key_codes.EKeyLeftArrow:
Loc_X = Loc_X - MOVE
lock.signal()
elif event['keycode'] == key_codes.EKeyRightArrow:
Loc_X = Loc_X + MOVE
lock.signal()
elif event['keycode'] == key_codes.EKeyUpArrow:
Loc_Y = Loc_Y - MOVE
lock.signal()
elif event['keycode'] == key_codes.EKeyDownArrow:
Loc_Y = Loc_Y + MOVE
lock.signal()
elif event['keycode'] == key_codes.EKeySelect:
quit()
def quit():
running = 0
lock.signal()
running = 1
appuifw.app.exit_key_handler = quit
appuifw.app.screen = 'large'
canvas = appuifw.Canvas(redraw_callback = handle_redraw, event_callback = handle_events)
W,H = canvas.size
panel = graphics.Image.new((W, H))
appuifw.app.body = canvas
lock = e32.Ao_lock()
while running:
handle_redraw((W, H))
lock.wait()
print Loc_X + ' ' + Loc_Y
Last edited by schmrz : 2007-11-29 at 00:34.
|
|
can anyone see the problem??
|
|
i can't believe that there is no one that can help me...
|
|
77 views no answer... is it that hard??
|
|
I tried to get your code working but couldn't after correcting it a bit it still didn't work and gave no errors
.So I decided to rewrite it completely: ![]() Code:
import key_codes, e32, graphics
from appuifw import *
point_size=10
point_color=(0,0,255)
move=1
loc_x=10
loc_y=10
def handle_redraw(rect=None):
panel.clear(0)
panel.point((loc_x,loc_y),point_color,width=point_size)
canvas.blit(panel)
def handle_event(event):
global loc_x,loc_y,move
if event['keycode'] == key_codes.EKeyLeftArrow:
loc_x = loc_x - move
elif event['keycode'] == key_codes.EKeyRightArrow:
loc_x = loc_x + move
elif event['keycode'] == key_codes.EKeyUpArrow:
loc_y = loc_y - move
elif event['keycode'] == key_codes.EKeyDownArrow:
loc_y = loc_y + move
elif event['keycode'] == key_codes.EKeySelect:
exit()
handle_redraw()
def exit():
lock.signal()
running=1
app.screen='large'
app.exit_key_handler=exit
canvas=Canvas(redraw_callback=handle_redraw,event_callback=handle_event)
w,h=canvas.size
panel=graphics.Image.new((w,h))
app.body=canvas
lock = e32.Ao_lock()
lock.wait()
![]() Nokia E66 PyS60 1.4.4 final |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Simple problem about S60 3rd | Aspen | General Symbian C++ | 9 | 2007-04-13 11:52 |
| symbian signed testing problem. | anglina | General Symbian C++ | 0 | 2007-02-01 11:15 |
| Problem with starting .exe from app | tripiri | General Symbian C++ | 5 | 2005-01-09 17:36 |
| CIMD2 receiving app problem | surfacing | General Messaging | 0 | 2004-10-29 04:29 |
| 7210 & 7250 RMS resetting problem | keithmcneill | Mobile Java General | 1 | 2003-11-13 22:04 |