You Are Here:

Community: Developer Discussion Boards

#1 Old Smile [PyS60 1.4.4] globalui example ... - 2008-06-27, 20:53

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
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")
another example ...
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)
BR
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
Reply With Quote

#2 Old Re: [PyS60 1.4.4] globalui example ... - 2008-06-27, 22:11

Join Date: Dec 2005
Posts: 44
anees042
Offline
Registered User
Hello cyke,

Thanks for sharing this great example.
Reply With Quote

#3 Old Question Re: [PyS60 1.4.4] globalui example ... - 2008-06-27, 22:16

Join Date: Apr 2004
Posts: 107
Send a message via ICQ to carknue
carknue
Offline
Regular Contributor
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
Reply With Quote

#4 Old Re: [PyS60 1.4.4] globalui example ... - 2008-06-27, 22:28

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Online
Forum Nokia Champion
Ah, Wow a Global note !

Someone has been asking about this on the DiBo (may be rishabh)

Thanks Cyke.

Best Regards,
Croozeus
Reply With Quote

#5 Old Re: [PyS60 1.4.4] globalui example ... - 2008-06-27, 22:32

Join Date: Mar 2003
Posts: 115
Dansco
Offline
Regular Contributor
Will give it a go, thanx mate
Reply With Quote

#6 Old Re: [PyS60 1.4.4] globalui example ... - 2008-06-28, 07:54

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
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
Reply With Quote

#7 Old Re: [PyS60 1.4.4] globalui example ... - 2008-06-28, 12:02

Join Date: Dec 2007
Posts: 409
Location: Tempe, AZ
Send a message via Yahoo to shubhendra Send a message via Skype™ to shubhendra
shubhendra's Avatar
shubhendra
Offline
Forum Nokia Champion
Ya Rishabh will be very happy seeing it.


IDEAS is all they need but still they think only Genius can give them that.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
[Pys60, 3rd Ed.] build problems MHOOO Python 3 2007-04-09 20:00

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia