WEB开发网      濠电娀娼ч崐濠氬疾椤愶附鍋熸い鏍ㄧ〒闂勫嫰鏌﹀Ο渚Ц闁诲氦顕ч湁婵犲﹤楠告禍鍓х磼鏉堛劌绗氶柟宄版嚇閹晠宕归銈嗘濠电偞鍨堕幐鎾磻閹捐秮褰掓偐閻戞﹩妫勯梺鎼炲妼鐎涒晝绮嬪澶樻晝闁挎繂鏌婇敃鍌涚厵閻庢稒锚閻忥絾绻濇繝鍐ㄧ伌闁诡垰鍟村畷鐔碱敂閸♀晙绱樺┑鐐差嚟婵儳螞閸曨剚鍙忛柍鍝勬噹缁€澶嬬箾閹存繄锛嶆鐐灲閹綊宕惰濡插鏌涢妸銉ヮ劉缂佸倸绉归弫鎾绘晸閿燂拷 ---闂備焦瀵уú鈺呭箯閿燂拷
开发学院手机开发Symbian 开发 Symbian S60 Python 编程指南 如何创建一个应用程... 阅读

Symbian S60 Python 编程指南 如何创建一个应用程序

 2010-08-30 00:06:00 来源:WEB开发网 闂備線娼уΛ鎾箯閿燂拷闂備礁鎲¢崹鐢垫崲閹扮増鍎嶆い鎺戝€甸崑鎾斥槈濞嗗秳娌紓鍌氱▌閹凤拷濠电姭鎷冮崨顓濈捕闂侀潧娲ゅú銊╁焵椤掍胶鈯曢柕鍥╁仧缁辩偤鏁撻敓锟�闂備線娼уΛ鎾箯閿燂拷  闂備胶枪缁绘鈻嶉弴銏犳瀬闁绘劖顐煎☉妯锋瀻闁归偊鍓涘▔姘舵⒑閸涘⿴娈旀繛灞傚妼閳绘捇骞嬪┑鎰濡炪倖姊婚崢褏鎲撮敓锟�
核心提示:global runningrunning=0appuifw.app.set_exit()# set the screen size to largeappuifw.app.screen='large'# define an initial image (white)img=Image.new((176

global running

running=0

appuifw.app.set_exit()

# set the screen size to large

appuifw.app.screen='large'

# define an initial image (white)

img=Image.new((176,208))

# add different shapes and text to the image

# coord. sequence x1,x2,y1,y2

img.line((20,20,20,120),0xff00ee)

img.rectangle((40,60,50,80),0xff0000)

img.point((50.,150.),0xff0000,width=40)

img.ellipse((100,150,150,180),0x0000ff)

img.text((100,80), u'hello')

# define your redraw function (that redraws the picture on and on)

# in this case we redraw the image named img using the blit function

def handle_redraw(rect):

canvas.blit(img)

running=1

# define the canvas, include the redraw callback function

canvas=appuifw.Canvas(event_callback=None, redraw_callback=handle_redraw)

# set the app.body to canvas

appuifw.app.body=canvas

app.exit_key_handler=quit

# create a loop to redraw the the screen again and again until the exit button is pressed

while running:

# redraw the screen

handle_redraw(())

# yield needs to be here in order that key pressings can be noticed

e32.ao_yield()

9,如何创建一个主循环?

把主循环放置在需要反复运行的代码位置

Python代码

1. running = 1

2. while running:

3. # #e.g. redraw the screen:

4. handle_redraw(())

1. running = 1

2. while running:

3. # #e.g. redraw the screen:

4. handle_redraw(())

示例代码:

---------------------------------

Python代码

# Copyright (c) 2006 Jurgen Scheible

# Application skeleton (no main loop)

import appuifw

import e32

上一页  3 4 5 6 7 8 9 10 11  下一页

Tags:Symbian Python 编程

编辑录入:coldstar [复制链接] [打 印]
赞助商链接