当前位置: 首页>>代码示例>>Python>>正文


Python Notebook.set_current_page方法代码示例

本文整理汇总了Python中notebook.Notebook.set_current_page方法的典型用法代码示例。如果您正苦于以下问题:Python Notebook.set_current_page方法的具体用法?Python Notebook.set_current_page怎么用?Python Notebook.set_current_page使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在notebook.Notebook的用法示例。


在下文中一共展示了Notebook.set_current_page方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Window

# 需要导入模块: from notebook import Notebook [as 别名]
# 或者: from notebook.Notebook import set_current_page [as 别名]

#.........这里部分代码省略.........
# 		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) &&
#					  !(lockdown & GEDIT_LOCKDOWN_SAVE_TO_DISK));

#		action = gtk_action_group_get_action (self._action_group,
开发者ID:jhasse,项目名称:taluka,代码行数:70,代码来源:window.py


注:本文中的notebook.Notebook.set_current_page方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。