Symbian S60 Python 编程指南 如何创建一个应用程序
2010-08-30 00:06:00 来源:WEB开发网# put the application screen size to full screen
appuifw.app.screen='full' #(a full screen)
# other options:
#appuifw.app.screen='normal' #(a normal screen with title pane and softkeys)
#appuifw.app.screen='large' #(only softkeys visible)
app_lock = e32.Ao_lock()
appuifw.app.body = round
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
3,如何创建你程序的逻辑结构?
这个完整的指南就是关于这个问题的…… 你必须确定一些逻辑结构使你的程序运行起来,任何逻辑结构都有可能!
4,如何创建一个应用程序菜单?
一个应用程序菜单使用左边的软按键并使得在你的应用程序运行时总是更够被使用。一个应用程序菜单也能包含子菜单。
Python代码
# create the callback functions that shall be executed when when selecting an item in
# the menu:
def item1():
print "item one"
def subitem1():
print "subitem one"
def subitem2():
print "subitem two"
# create the menu using appuifw.app.menu[(title, callback1), (title, (subtitle, callback2))]
appuifw.app.menu = [(u"item 1", item1), (u"Submenu 1", ((u"sub item 1"
, subitem1),(u"sub item 2", subitem2)))]
# create the callback functions that shall be executed when when selecting an item in
# the menu:
def item1():
print "item one"
def subitem1():
print "subitem one"
def subitem2():
print "subitem two"
# create the menu using appuifw.app.menu[(title, callback1), (title, (subtitle, callback2))]
appuifw.app.menu = [(u"item 1", item1), (u"Submenu 1", ((u"sub item 1"
, subitem1),(u"sub item 2", subitem2)))]
示例代码:
---------------------------------
Python代码
import appuifw
import e32
更多精彩
赞助商链接