信息: 如何创建一个应用程序? 9个步骤
- 插入所有需要的模块
- 设定屏幕大小 (normal, large, full)
- 编写你程序的逻辑代码
- 创建一个程序菜单(如果有必要)
- 设定一个离开的按键
- 设定程序标题
- 如果有必要,分配活动的对象
- 设定程序主题(文字,背景,列表或什么都没有)
- 创建一个恰当的主循环体
- 如何装如所需要的所有模块?
- import appuifw
- import e32
- 如何设定屏幕大小?
- # screen has 3 different values:
- appuifw.app.screen='normal' #(a normal screen with title pane and softkeys)
- appuifw.app.screen='large' #(only softkeys visible)
- appuifw.app.screen='full' #(a full screen)
示例代码: ----------------------------------------- import appuifw import e32 def exit_key_handler(): app_lock.signal() round = appuifw.Text() round.set(u'hello') # 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() -----------------------------------
- 如何创建你程序的逻辑结构?
这个完整的指南就是关于这个问题的…… 你必须确定一些逻辑结构使你的程序运行起来,任何逻辑结构都有可能!
- 如何创建一个应用程序菜单?
一个应用程序菜单使用左边的软按键并使得在你的应用程序运行时总是更够被使用。一个应用程序菜单也能包含子菜单。
- # 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"
[1] [2] [3] [4] 下一页 |