sonist-gtk/ui/title_text.py

22 lines
450 B
Python
Raw Normal View History

2023-08-24 17:04:41 +08:00
#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class TitleText(Gtk.Label):
def __init__(self, text = 'mpd loading...'):
Gtk.Box.__init__(self)
self.set_size_request(256, 20)
self.set_name('text')
self.set_hexpand(True)
self.set_hexpand_set(True)
self.set_halign(Gtk.Align.CENTER)
self.set_text(text)
def update(self, text):
self.set_text(text)
return self