def __init__(self, data, chapter):
"""
Holds data that is chapter name and chapter_link that is link to chapter file. For use as ListBox element.
:param data:
:param chapter:
"""
super(Gtk.ListBoxRow, self).__init__()
# Remember chapter name and file link
self.data = data
self.chapter_link = chapter
# Just a bunch of label styling
label = Gtk.Label(xalign=0)
label.set_text(data)
label.set_justify(Gtk.Justification.LEFT)
try:
label.set_margin_start(10)
except AttributeError:
label.set_margin_left(10)
label.set_width_chars(20)
label.set_ellipsize(Pango.EllipsizeMode.END)
self.add(label)
评论列表
文章目录