| Reply | « Previous Thread | Next Thread » |
|
Hello ,
The only new feature in the new release is a new module addition : globalui "The globalui module offers an interface to the S60 global UI notifiers. This allows a global note and query to be launched from an application which does not have a UI environment" ie without using appuifw ! very simple example : Code:
import globalui, time text_to_show = u"text for showing note" globalui.global_note(text_to_show,'error') time.sleep(6) globalui.global_note(text_to_show) time.sleep(6) result = globalui.global_query(u"do you want to continue ?") time.sleep(6) listresult = globalui.global_popup_menu([u"MenuItem1",u"MenuItem2"],u"Select item") Code:
# Copyright (c) 2008 Nokia Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import globalui, time
count = 1
while count!= 2:
text_to_show = u"times: " + str(count)
# globalui.global_note(text_to_show)
globalui.global_note(text_to_show,'error')
# globalui.global_note(text_to_show,'info')
# globalui.global_note(text_to_show,'warn')
# globalui.global_note(text_to_show,'confirm')
# globalui.global_note(text_to_show,'charging')
# globalui.global_note(text_to_show,'text')
# globalui.global_note(text_to_show,'wait')
# globalui.global_note(text_to_show,'perm')
# globalui.global_note(text_to_show,'not_charging')
# globalui.global_note(text_to_show,'battery_full')
# globalui.global_note(text_to_show,'battery_low')
# globalui.global_note(text_to_show,'recharge_battery')
count = count + 1
time.sleep(3)
print u"test done"
result = globalui.global_query(u"do you want to continue?");
if result == 1:
globalui.global_note(u"pressed yes")
else:
globalui.global_note(u"Pressed no")
time.sleep(6)
result = globalui.global_msg_query(u"i am global message",u"MyHeader");
if result == 1:
globalui.global_note(u"pressed ok")
else:
globalui.global_note(u"Pressed cancel")
time.sleep(6)
result = globalui.global_popup_menu([u"item1", u"item2"],u"MyMenu")
print "Selected item is: " + str(result)
Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/
Last edited by cyke64 : 2008-06-29 at 03:32.
Reason: add another example
|
|
Hello cyke,
Thanks for sharing this great example. |
|
Is it possible to send a global UI notifier or query from a thread?
PyNetMony - the ultimate War- and BlueWalking tool and 2G/3G Netmonitor http://pynetmony.googlepages.com/home |
|
Ah, Wow a Global note !
Someone has been asking about this on the DiBo (may be rishabh) Thanks Cyke. Best Regards, Croozeus |
|
Will give it a go, thanx mate
![]() |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi cyke
thanks for sharing the cool piece of information. ![]() ![]() Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Ya Rishabh will be very happy seeing it.
IDEAS is all they need but still they think only Genius can give them that. |
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| [Pys60, 3rd Ed.] build problems | MHOOO | Python | 3 | 2007-04-09 20:00 |