__init__.py 文件源码

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

项目:Dict-O-nator 作者: theawless 项目源码 文件源码
def bottom_bar_handler(self, tim: time, text: str, action: str):
        """Add actions to the eventlist in the bottom bar.

        :param tim: Time of action.
        :param text: Recognized text.
        :param action: Action performed.
        """
        row = Gtk.ListBoxRow()
        box = Gtk.HBox()
        box.set_homogeneous(True)
        text_label = Gtk.Label(text)
        text_label.set_line_wrap(True)
        box.pack_start(Gtk.Label(tim), False, False, 0)
        box.pack_start(text_label, True, True, 0)
        box.pack_start(Gtk.Label(action), False, False, 0)
        row.add(box)
        # Remove old entries
        if self.bottom_widget.get_object("event_list").get_row_at_index(40):
            self.bottom_widget.get_object("event_list").get_row_at_index(40).destroy()
        row.show_all()
        self.bottom_widget.get_object("event_list").prepend(row)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号