Reply
Thread Tools
Posts: 3 | Thanked: 0 times | Joined on Oct 2008
#1
I'm interested in doing a little Python programming on my n800, and one of the things that I would like to do is create a moon phase applet for the task navigator (to replace the Contacts menu, which I don't use). I'm all set up with scratchbox, I've got the images and code for showing the moon's phase, and I found pytaskbar.py to start off with. Now I only have two questions before I start.

1. Is it actually possible to do what I'm thinking about? Looking at pytaskbar.py, it's clear that the menus are just buttons, but is it possible to change the image of the button? That is, at least twice a day it will be necessary to change the image of the moon. Forgive my ignorance of GTK, I'm still learning it.

2. The other question is, how do I get a taskbar applet to reload in scratchbox? That is, when I make changes to the code, is there a command that will reload it?

Thanks!
 
allnameswereout's Avatar
Posts: 3,397 | Thanked: 1,212 times | Joined on Jul 2008 @ Netherlands
#2
You can use at or crond to issue a command on specific times, and sleep to issue timed intervals.
__________________
Goosfraba! All text written by allnameswereout is public domain unless stated otherwise. Thank you for sharing your output!
 
darethehair's Avatar
Posts: 273 | Thanked: 104 times | Joined on Mar 2007 @ Manitoba, Canada
#3
Well, I haven't tried it myself, but PyGTK *is* able to define buttons with images:

http://faq.pygtk.org/index.py?req=sh...=faq09.002.htp

As well, the tutorial also has an example:

http://www.pygtk.org/pygtk2tutorial/...html#imagesfig
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#4
for the question number 2, easiest way is probably to restart the whole hildon-desktop with "/etc/init.d/hildon-desktop stop && /etc/init.d/hildon-desktop start"
 
Posts: 3 | Thanked: 0 times | Joined on Oct 2008
#5
Thanks, everyone, for your suggestions. It turns out that yes, task navigator applets are just regular applets, so by adding a timer function, I can indeed change the image on a regular basis.

As for reloading the applet, the only effective way I have found is to use the control panel. I have to unselect my applet, select another one, hit ok, then open up the Panel option again, unselect the other applet and select my applet in order to get it to reload. I was hoping for a quicker, more effective way, but in the absence of anything better, it will do.
 
allnameswereout's Avatar
Posts: 3,397 | Thanked: 1,212 times | Joined on Jul 2008 @ Netherlands
#6
Please take a look at Eventuality or other freedesktop.org projects. They might overlap with your project, or be of use.
__________________
Goosfraba! All text written by allnameswereout is public domain unless stated otherwise. Thank you for sharing your output!
 
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#7
You can use at or crond to issue a command on specific times, and sleep to issue timed intervals.
Ouch ! Hum you can use also alarmd for that. And it ll not drain your battery for nothing.
 
Reply


 
Forum Jump


All times are GMT. The time now is 12:49.