TimeLabel()

Made a time label that updates ever 5 seconds to show the current time
into the song.
This commit is contained in:
Bryan Schumaker 2010-10-18 21:05:50 -04:00
parent d56f3b2d0a
commit 67676d2d62
1 changed files with 27 additions and 0 deletions

27
ocarina/label.py Normal file
View File

@ -0,0 +1,27 @@
# Bryan Schumaker (10 / 18 / 2010)
import ocarina
gtk = ocarina.gtk
gobject = ocarina.gobject
#update = None
get_time = None
def set_fns():
#global update
global get_time
#update = ocarina.libsaria.music.get_progress
get_time = ocarina.libsaria.music.get_time
ocarina.libsaria.event.invite("POSTSTART", set_fns)
class TimeLabel(gtk.Label):
def __init__(self):
gtk.Label.__init__(self)
gobject.timeout_add(500, self.update)
self.show()
def update(self):
global get_time
self.set_text(get_time())
return True