Reply
Thread Tools
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#1
Does anyone have a code example for python (qt or gtk, doesn't matter) for a status bar application?

By status bar I don't mean the one like the "Clock & Alarms" button, or any other button that appear after you press the status bar itself, but those tiny icons next to the battery and the time, no press is needed.

Applications that do that, as an example, are mStatus applet (which was writted in C, not python) and Tor (which was also written in C).

Last edited by omeriko9; 2010-03-01 at 17:37.
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
Save https://bugs.maemo.org/attachment.cgi?id=1579 (from https://bugs.maemo.org/show_bug.cgi?id=6136) as /usr/lib/hildon-desktop/example.py but remove "gobject.timeout_add(1000, self.set_status_area_icon, None)" from it.

/usr/share/applications/hildon-status-menu/example.desktop (Taken from OpenVPN applet):
Code:
[Desktop Entry]
Name=Example
Type=python
X-Path=example
killall hildon-status-menu and lo and behold.
 

The Following 2 Users Say Thank You to qwerty12 For This Useful Post:
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#3
Thank you very much! I'll give it a shot
 
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#4
@qwerty12 - I tried it and it's working as expected - thank you very much!!! Couldn't find anything in google...

Can I ask you where did you aquired that knowledge from? Is there a documentation for this kind of app or did you converted a C code from your own knowledge with C and python?

Thanks again!
 

The Following User Says Thank You to omeriko9 For This Useful Post:
Posts: 53 | Thanked: 90 times | Joined on Nov 2009 @ Manaus, Brazil
#5
Originally Posted by omeriko9 View Post
@qwerty12 - I tried it and it's working as expected - thank you very much!!! Couldn't find anything in google...

Can I ask you where did you aquired that knowledge from? Is there a documentation for this kind of app or did you converted a C code from your own knowledge with C and python?

Thanks again!
The PyMaemo (Python for Maemo) wiki pages also have an example:

http://wiki.maemo.org/PyMaemo/Hildon...mantle_only.29
__________________
Anderson Lizardo
 

The Following 2 Users Say Thank You to lizardo For This Useful Post:
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#6
Originally Posted by omeriko9 View Post
@qwerty12 - I tried it and it's working as expected - thank you very much!!! Couldn't find anything in google...

Can I ask you where did you aquired that knowledge from? Is there a documentation for this kind of app or did you converted a C code from your own knowledge with C and python?

Thanks again!
Oh, I can't take credit for the Python code; that goes to Lizardo.

I wrote the Simple Brightness Applet in C a long while back and I wanted to display an icon, like Nokia's widgets did. So I looked at the libhildondesktop API reference manual and found the hd_status_plugin_item_set_status_area_icon () function.

I didn't know the Python equivalent so I grabbed the python-hildondesktop source and searched for hd_status_plugin_item_set_status_area_icon in libhildondesktop/hildondesktop.defs. I saw that the Python method is called "set_status_area_icon" so I searched for that!
 

The Following 3 Users Say Thank You to qwerty12 For This Useful Post:
Posts: 53 | Thanked: 90 times | Joined on Nov 2009 @ Manaus, Brazil
#7
Originally Posted by omeriko9 View Post
Can I ask you where did you aquired that knowledge from? Is there a documentation for this kind of app or did you converted a C code from your own knowledge with C and python?
And to complete, for Python and Maemo related documentation/examples, your first stop should be the Maemo Wiki:

http://wiki.maemo.org/PyMaemo
http://wiki.maemo.org/Category:Python (all wiki articles under "Python" category)
__________________
Anderson Lizardo
 

The Following 2 Users Say Thank You to lizardo For This Useful Post:
Posts: 3,664 | Thanked: 1,530 times | Joined on Sep 2009 @ Hamilton, New Zealand
#8
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:17.