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)
评论列表
文章目录