def timer(self):
if len(self.additional_windows_list) != 0:
for window in self.additional_windows_list:
window_notebook = window.get_child()
if window_notebook != None:
window_notebook_n_pages = window_notebook.get_n_pages()
for i in range(window_notebook_n_pages):
page_name = window_notebook.get_nth_page(i).get_name()
if page_name not in self.detached_tabs_names:
self.detached_tabs_names.append(page_name)
if (len(self.detached_tabs_names) + self.notebook.get_n_pages()) == 5:
self.button_add_tab.set_visible(False)
else:
self.button_add_tab.set_visible(True)
GObject.timeout_add(1000, self.timer)
评论列表
文章目录