首 页 | 新 闻 | Symbian | Android| Windows Mobile | J2ME | 下载中心 | 游戏策划招聘与求职 | 购书指南 | 视频教程
您现在的位置: 开发视界 >> Symbian >> 用户界面 >> 正文
S60 Python 编程指南——弹出列表
作者:佚名    文章来源:转载    更新时间:2007-1-6 10:38:19
1、创建一个有3个选项的弹出菜单:
选项1显示: Python
选项2显示: Symbian
选项3显示: Mlab
2、运行脚本:
当用户从弹出菜单确定一个选项后,作出一个弹出通知的反馈(每个选项各有不同)。
ab

事例代码:
# Copyright (c) 2005 Jurgen Scheible
# simple pop-up menu
import appuifw
L = [u"Python", u"Symbian", u"Mlab"]
test = appuifw.popup_menu(L, u"Select + press OK:")
if test == 0 :
    appuifw.note(u"Python, yeah", "info")
if test == 1 :
    appuifw.note(u"Symbian, ok", "info")
if test == 2 :
    appuifw.note(u"Mlab, cool students", "info")

代码说明:
# Copyright (c) 2005 Jurgen Scheible
# simple pop-up menu
import appuifw
# create a list with the content of the pop-up note
L = [u"Python", u"Symbian", u"Mlab"]
# create the pop-up menu including the list of content and a label
# -> appuifw.popup_menu(list , label)
test = appuifw.popup_menu(L, u"Select + press OK:")
# the variable test holds the indicator which list item (position in the list)
# has been selected
# trigger some action (here we print something)
if test == 0 :
    appuifw.note(u"Python, yeah", "info")
if test == 1 :
    appuifw.note(u"Symbian, ok", "info")
if test == 2 :
    appuifw.note(u"Mlab, cool students", "info")
相关文章:
列举系统当前所有进程
小试Python for Symbian
S60 Python 编程指南——程序菜单练习(2)
Python on Symbian system
Python for symbian 安装指南
S60 Python 编程指南——对话框和通知信息
S60 Python 编程指南——语法
S60 Python 编程指南——怎样编写并测试Series60上的Python脚本
 

站点地图 | 加入收藏 | 联系站长 | 广告服务 |
QQ:280529124  Tel:0592-8271361 辽ICP备05021703号