chapters_list.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Ebook-Viewer 作者: michaldaniel 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号