ocarina/src/extra/oGtk/songInfo.py

44 lines
1.0 KiB
Python

#! /usr/bin/python
# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="bjschuma"
__date__ ="$Mar 15, 2010 10:01:39 PM$"
import gtk
import ocarina
from oGtk import label
import guibuilder
class SongInfo(gtk.ScrolledWindow):
def __init__(self):
gtk.ScrolledWindow.__init__(self)
self.set_policy(gtk.POLICY_ALWAYS, gtk.POLICY_NEVER)
box = gtk.VBox(False,0)
self.title = label.Label2(13000,700)
self.artist = label.Label2(10000,400)
self.album = label.Label2(10000,400)
box.pack_start(self.title,False,False,0)
box.pack_start(self.album,False,False,0)
box.pack_start(self.artist,False,False,0)
self.add_with_viewport(box)
self.setLabels()
ocarina.events.invite("tags-changed", self.setLabels)
self.show_all()
def setLabels(self):
self.title.set_text(ocarina.vars["$title"])
self.album.set_text("from " + ocarina.vars["$album"])
self.artist.set_text("by " + ocarina.vars["$artist"])
def make_songinfo(attrs=None):return SongInfo()
guibuilder.parts["songinfo"] = make_songinfo