sonist-gtk/ui/text.py

21 lines
381 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
2023-08-18 19:04:51 +08:00
class TextBox(Gtk.Box):
2023-08-17 20:51:59 +08:00
def __init__(self, width, height):
2023-08-18 19:04:51 +08:00
Gtk.Box.__init__(self)
2023-08-17 20:51:59 +08:00
self.set_size_request(width, height)
self.label = Gtk.Label()
self.add(self.label)
2023-08-18 19:04:51 +08:00
2023-08-17 20:51:59 +08:00
def set_text(self, string):
2023-08-18 19:04:51 +08:00
self.label.set_text('孙晓 - 丹歌惊鸿')
return self