def on_tab_changed(self, event):
"""
Close the previous tab and initialize a new one
:param event: tab event
:return: None
"""
tab_id = self.notebook.select()
tab_index = self.notebook.index(tab_id)
tab_name = self.notebook.tab(tab_index, "text")
LoggerGui.debug("Notebook tab changed to \"%s\" with id %d", tab_name, tab_index)
self.tab_id = tab_id.split(".")[len(tab_id.split(".")) - 1] # Parse notebook/tab id to only tab id
if self.notebook.children[self.tab_id].kill_other_tabs():
for tab in self.notebook.children:
if tab != self.tab_id:
self.notebook.children[tab].deactivate()
self.notebook.children[self.tab_id].activate()
评论列表
文章目录