对话框和通知信息

信息: 输入区(单个输入区对话框)和弹出通知(通知)

单个输入区对话框: appuifw.query()

以下这些行用来实现一个单独对话框,每一行使用不同的输入类型。他们都是使用了 appuifw 模块中的 .query() 函数。

1
appuifw.query(label,type)

其中 label 必须是 unicode 字符编码。

示例代码: query.py

文本

文本

1
data = appuifw.query(u"Type a word:", "text")

数字

数字

1
data = appuifw.query(u"Type a number:", "number")

日期

日期

1
data = appuifw.query(u"Type a date:", "date")

时间

时间

1
data = appuifw.query(u"Type a time:", "time")

密码

密码

1
data = appuifw.query(u"Type a code:", "code")

疑问

疑问

1
data = appuifw.query(u"Are you ok:", "query")

-

弹出消息: appuifw.note()

以下这些示例展示了弹出消息的不同类型:info, error, conf ,他们都使用 appuifw 模块中的 .note() 函数

1
appuifw.note(label, type)

其中 label 必须是unicode字符编码

示例代码: note.py

信息

信息

1
appuifw.note(u"Hello", "info")

错误

错误

1
appuifw.note(u"file not found", "error")

返回状态

返回状态

1
appuifw.note(u"upload done", "conf")
Share

0 Responses to “对话框和通知信息”


  • No Comments

Leave a Reply