Symbian S60 Python 编程指南 如何创建一个应用程序
2010-08-30 00:06:00 来源:WEB开发网Python代码
import appuifw
import e32
def exit_key_handler():
app_lock.signal()
# define a callback function
def shout():
index = lb.current()
print index
print entries[index]
# create your content list of your listbox including the icons to be used for each entry
entries = [u"Signal",u"Battery"]
lb = appuifw.Listbox(entries,shout)
# create an Active Object
app_lock = e32.Ao_lock()
# create an instance of appuifw.Listbox(), include the content list "entries" and the callback function "shout"
# and set the instance of Listbox now as the application body
appuifw.app.body = lb
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
import appuifw
import e32
def exit_key_handler():
app_lock.signal()
# define a callback function
def shout():
index = lb.current()
print index
print entries[index]
# create your content list of your listbox including the icons to be used for each entry
entries = [u"Signal",u"Battery"]
lb = appuifw.Listbox(entries,shout)
# create an Active Object
app_lock = e32.Ao_lock()
# create an instance of appuifw.Listbox(), include the content list "entries" and the callback function "shout"
# and set the instance of Listbox now as the application body
appuifw.app.body = lb
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
Python代码
# body as Text:
appuifw.app.body = appuifw.Text(u'hello')
# body as Text:
appuifw.app.body = appuifw.Text(u'hello')
示例代码:
------------------------------------------------
更多精彩
赞助商链接