def update(self, tablist: list, tabcurr: int):
"""Updates the widget's tabs.
:tablist: list of tab names.
:tabcurr: the active buffer's number.
"""
self.props.updating = True
for _ in range(self.get_n_pages()):
self.remove_page(-1)
for name in tablist:
page = Gtk.Box()
self.append_page(page, Gtk.Label(name))
self.child_set_property(page, 'tab-expand', True)
self.show_all()
self.set_current_page(tabcurr - 1)
self.set_show_tabs(self.get_n_pages() > 1)
self.props.updating = False
评论列表
文章目录