Symbian S60 Python 编程指南 如何创建一个应用程序
2010-08-30 00:06:00 来源:WEB开发网 闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁惧墽鎳撻—鍐偓锝庝簻椤掋垺銇勯幇顖毿撻柟渚垮妼椤粓宕卞Δ鈧獮濠勭磽閸屾艾鈧懓顫濋妸鈺佺疅缂佸顑欓崥瀣煕椤愵偅绶氱紓鍐╂礋濮婂宕掑▎鎴М濠电姭鍋撻梺顒€绉甸幆鐐哄箹濞n剙濡肩紒鎰殜閺屸€愁吋鎼粹€茬敖婵炴垶鎸哥粔鐢稿Φ閸曨垰鍐€妞ゆ劦婢€濞岊亪姊虹紒妯诲蔼闁稿海鏁诲濠氭晲婢跺﹤宓嗛梺缁樺姈缁佹挳宕戦幘璇叉嵍妞ゆ挻绋戞禍鐐叏濡厧浜鹃悗姘炬嫹

appuifw.app.screen='large'
# create your application logic ...
def item1():
print "hello"
def subitem1():
print "aha"
def subitem2():
print "good"
appuifw.app.menu = [(u"item 1", item1),
(u"Submenu 1", ((u"sub item 1", subitem1),
(u"sub item 2", subitem2)))]
def exit_key_handler():
app_lock.signal()
appuifw.app.title = u"drawing"
app_lock = e32.Ao_lock()
appuifw.app.body = ...
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
""" description:
# 1. import all modules needed
import appuifw
import e32
# 2. set the screen size to large
appuifw.app.screen='large'
# 3. create your application logic ...
# e.g. create all your definitions (functions) or classes and build instances of them or call them etc.
# ...... application logic ....
# 4. create the application menu including submenus
# create the callback functions for the application menu and its submenus
def item1():
print ""
round.set(u'item one was selected')
def item1():
print "hello"
def subitem1():
print "aha"
def subitem2():
print "good"
appuifw.app.menu = [(u"item 1", item1),
(u"Submenu 1", ((u"sub item 1", subitem1),
(u"sub item 2", subitem2)))]
# 5. create and set an exit key handler
def exit_key_handler():
app_lock.signal()
# 6. set the application title
appuifw.app.title = u"drawing"
# 7. crate an active objects
app_lock = e32.Ao_lock()
# 8. set the application body
appuifw.app.body = ...
# no main loop
更多精彩
赞助商链接