本文整理汇总了Python中notebook.Notebook.add_tab方法的典型用法代码示例。如果您正苦于以下问题:Python Notebook.add_tab方法的具体用法?Python Notebook.add_tab怎么用?Python Notebook.add_tab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notebook.Notebook
的用法示例。
在下文中一共展示了Notebook.add_tab方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Window
# 需要导入模块: from notebook import Notebook [as 别名]
# 或者: from notebook.Notebook import add_tab [as 别名]
#.........这里部分代码省略.........
# if (gedit_prefs_manager_get_bottom_panel_visible ())
# {
# gtk_widget_show (window->priv->bottom_panel);
# }
# }
# else
# {
# GtkAction *action;
# action = gtk_action_group_get_action (window->priv->panes_action_group,
# "ViewBottomPane");
# gtk_action_set_sensitive (action, FALSE);
# }
# /* start track sensitivity after the initial state is set */
# window->priv->bottom_panel_item_removed_handler_id =
# g_signal_connect (window->priv->bottom_panel,
# "item_removed",
# G_CALLBACK (bottom_panel_item_removed),
# window);
# g_signal_connect (window->priv->bottom_panel,
# "item_added",
# G_CALLBACK (bottom_panel_item_added),
# window);
# }
def on_delete_event(self, widget, event, data=None):
return False
def create_tab(self, jump_to):
tab = Tab()
tab.show()
self._notebook.add_tab(tab, -1, jump_to)
return tab
def create_tab_from_uri(self, uri, encoding, line_pos, create, jump_to):
if uri == None:
return None
tab = tab_new_from_uri(uri, encoding, line_pos, create)
if tab == None:
return None
tab.show()
self._notebook.add_tab(tab, -1, jump_to)
return tab
def close_tab(self, tab):
if tab.get_state() == TAB_STATE_SAVING or tab.get_state() == TAB_STATE_SHOWING_PRINT_PREVIEW:
return
self._notebook.remove_tab(tab)
def close_all_tabs(self):
if self._state & WINDOW_STATE_SAVING or self._state & WINDOW_STATE_SAVING_SESSION:
return
self._removing_tabs = True
self._notebook.remove_all_tabs()
self._removing_tabs = False
def get_active_tab(self):
return self._active_tab
def get_documents(self):