本文整理汇总了Python中notebook.Notebook.page_num方法的典型用法代码示例。如果您正苦于以下问题:Python Notebook.page_num方法的具体用法?Python Notebook.page_num怎么用?Python Notebook.page_num使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notebook.Notebook
的用法示例。
在下文中一共展示了Notebook.page_num方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Window
# 需要导入模块: from notebook import Notebook [as 别名]
# 或者: from notebook.Notebook import page_num [as 别名]
#.........这里部分代码省略.........
#
# self.active_project = None
#
# start_here = self.glade.get_widget("start_tab_event") # TODO: Don't use a EventBox
# # geht nicht: start_here.set_events(gtk.gdk.BUTTON_PRESS_MASK)
# start_here.connect("button-press-event", self.on_tab_click, 0)
#
# self._bottom_panel = Panel(self)
#
# def on_tab_click(self, widget, event, tab_index):
# if event.button == 2:
# self._notebook.remove_page(tab_index)
# elif event.button == 3:
# print "Kontextmenü"
def set_title(self):
# TODO: This function may be improved. Should display project name
if self._active_tab == None:
super(type(self), self).set_title("Taluka IDE")
return
doc = self._active_tab.get_document()
name = doc.get_short_name_for_display()
super(type(self), self).set_title("%s - Taluka IDE" % name)
def get_active_view(self):
if self._active_tab == None:
return None
return self._active_tab.get_view()
def set_active_tab(self, tab):
page_num = self._notebook.page_num(tab)
if page_num == -1:
return
self._notebook.set_current_page(page_num)
def update_recent_files_menu(self): # TODO
pass
def set_sensitivity_according_to_tab(self, tab):
# TODO: Implement all of this
debug(DEBUG_WINDOW)
lockdown = app_get_default().get_lockdown()
# state = gedit_tab_get_state (tab);
# state_normal = (state == GEDIT_TAB_STATE_NORMAL);
# view = gedit_tab_get_view (tab);
# editable = gtk_text_view_get_editable (GTK_TEXT_VIEW (view));
# doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)));
# clipboard = gtk_widget_get_clipboard (GTK_WIDGET (window),
# GDK_SELECTION_CLIPBOARD);
# action = gtk_action_group_get_action (self._action_group,
# "FileSave");
# gtk_action_set_sensitive (action,
# (state_normal ||
# (state == GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION) ||
# (state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)) &&
# !gedit_document_get_readonly (doc) &&