Tab 1:
Tab 2

Tab 3

信息: 其他的 appuifw.app 属性: Tabs , Forms
标签: appuifw.app.set_tabs(tabnames, callback)
标签用来进行程序的页面选择。这里简单介绍了如何创建标签:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # define application 1: text app app1 = appuifw.Text(u'Appliation o-n-e is on') # define application 2: text app app2 = appuifw.Text(u'Appliation t-w-o is on') # define application 3: text app app3 = appuifw.Text(u'Appliation t-h-r-e-e is on') def exit_key_handler(): app_lock.signal() # create a tab handler that switches the application based on what tab is selected def handle_tab(index): global lb if index == 0: appuifw.app.body = app1 # switch to application 1 if index == 1: appuifw.app.body = app2 # switch to application 2 if index == 2: appuifw.app.body = app3 # switch to application 3 # create the tabs with its names in unicode as a list, include the tab handler appuifw.app.set_tabs([u"One", u"Two", u"Three"],handle_tab) |
- 示例代码 1: app_tabs_simple.py
- 示例代码 2: app_tabs_advanced.py
Forms: appuifw.app.form()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # define the content list (consists of tuples: (label, type ,value)); label is a unicode string # type is one of the following strings: 'text', 'number', 'date', 'time',or 'combo' # create a list to be used in 'combo' selection mode model = [u'6600', u'6630', u'7610', u'N90', u'N70'] data = [(u'Mobile','text', u'Nokia'),(u'Model','combo', (model,0)),(u'Amount','number', 5), (u'Date','date'), (u'Time','time')] # set the view/edit mode of the form flags = appuifw.FFormEditModeOnly # creates the form f = appuifw.Form(data, flags) # make the form visible on the UI f.execute() |
更多关于 forms 的参数请查看 Nokia API_Reference_for_python 文档
示例代码: form.py
0 Responses to “信息标签”