sonist-gtk/ui/text.py

23 lines
450 B
Python
Raw Normal View History

2023-08-17 20:51:59 +08:00
#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class TextBox(Gtk.EventBox):
def __init__(self, width, height):
Gtk.EventBox.__init__(self)
self.set_size_request(width, height)
self.label = Gtk.Label()
align = Gtk.Alignment(xalign=0.5, yalign=0.5)
self.add(self.label)
self.add(align)
def set_text(self, string):
self.label.set_text('孙晓 - 丹歌惊鸿')