亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

pygtk-notebook

系統 1926 0

?

?

    #!/usr/bin/env python
# example notebook.py
import pygtk
pygtk.require('2.0')
import gtk
class NotebookExample:
# This method rotates the position of the tabs
	def rotate_book(self, button, notebook):
		notebook.set_tab_pos((notebook.get_tab_pos()+1) %4)
# Add/Remove the page tabs and the borders
	def tabsborder_book(self, button, notebook):
		tval = False
		bval = False
		if self.show_tabs == False:
			tval = True
		if self.show_border == False:
			bval = True
		notebook.set_show_tabs(tval)
		self.show_tabs = tval
		notebook.set_show_border(bval)
		self.show_border = bval

# Remove a page from the notebook
	def remove_book(self, button, notebook):
		page = notebook.get_current_page()
		notebook.remove_page(page)
		# Need to refresh the widget --
		# This forces the widget to redraw itself.
		notebook.queue_draw_area(0,0,-1,-1)

	def delete(self, widget, event=None):
		gtk.main_quit()
		return False

	def __init__(self):
		window = gtk.Window(gtk.WINDOW_TOPLEVEL)
		window.connect("delete_event", self.delete)
		window.set_border_width(10)

		table = gtk.Table(3,6,False)
		window.add(table)

		# Create a new notebook, place the position of the tabs
		notebook = gtk.Notebook()
		notebook.set_tab_pos(gtk.POS_TOP)
		table.attach(notebook, 0,6,0,1)
		notebook.show()
		self.show_tabs = True
		self.show_border = True
		# Let’s append a bunch of pages to the notebook
		for i in range(5):
			bufferf = "Append Frame %d" % (i+1)
			bufferl = "Page %d" % (i+1)

			frame = gtk.Frame(bufferf)
			frame.set_border_width(10)
			frame.set_size_request(100, 75)
			frame.show()

			label = gtk.Label(bufferf)
			frame.add(label)
			label.show()

			label = gtk.Label(bufferl)
			notebook.append_page(frame, label)

			# Now let’s add a page to a specific spot
		checkbutton = gtk.CheckButton("Check me please!")
		checkbutton.set_size_request(100, 75)
		checkbutton.show ()

		label = gtk.Label("Add page")
		notebook.insert_page(checkbutton, label, 2)

	# Now finally let’s prepend pages to the notebook
		for i in range(5):
			bufferf = "Prepend Frame %d" % (i+1)
			bufferl = "PPage %d" % (i+1)

			frame = gtk.Frame(bufferf)
			frame.set_border_width(10)
			frame.set_size_request(100, 75)
			frame.show()

			label = gtk.Label(bufferf)
			frame.add(label)
			label.show()

			label = gtk.Label(bufferl)
			notebook.prepend_page(frame, label)

		# Set what page to start at (page 4)
		notebook.set_current_page(3)

		# Create a bunch of buttons
		button = gtk.Button("close")
		button.connect("clicked", self.delete)
		table.attach(button, 0,1,1,2)
		button.show()
		button = gtk.Button("next page")
		button.connect("clicked", lambda w: notebook.next_page())
		table.attach(button, 1,2,1,2)
		button.show()

		button = gtk.Button("prev page")
		button.connect("clicked", lambda w: notebook.prev_page())
		table.attach(button, 2,3,1,2)
		button.show()

		button = gtk.Button("tab position")
		button.connect("clicked", self.rotate_book, notebook)
		table.attach(button, 3,4,1,2)
		button.show()

		button = gtk.Button("tabs/border on/off")
		button.connect("clicked", self.tabsborder_book, notebook)
		table.attach(button, 4,5,1,2)
		button.show()

		button = gtk.Button("remove page")
		button.connect("clicked", self.remove_book, notebook)
		table.attach(button, 5,6,1,2)
		button.show()

		table.show()
		window.show()

def main():
	gtk.main()
	return 0

if __name__ == "__main__":
	NotebookExample()
	main()
  

?


pygtk-notebook
?

?

?

?

?

pygtk-notebook


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日本aaaa特级毛片 | 成人看片黄a毛片 | 四虎b7j77com | 日韩精品视频观看 | 在线看的毛片 | 欧美国产激情二区三区 | 国产欧美日韩综合二区三区 | 超级乱淫视频aⅴ播放视频 超级乱淫视频播放日韩 | 日韩se| 69色视频日韩在线视频 | 欧美国产亚洲一区 | 老外黑人欧美一级毛片 | 波多野结衣三区 | 久久国产加勒比精品无码 | 亚洲在线免费观看 | 日韩免费黄色片 | 国产在线短视频 | 久久精品是免费100 久久精品首页 | 丁香婷婷六月 | 996re免费热在线视频手机 | 成人影院在线观看kkk4444 | 四虎影永久在线观看精品 | 香蕉国产 | 不卡中文一二三区 | 国产一级影院 | 国产中文字幕视频 | 韩国一级特黄毛片大 | 久久96国产精品久久久 | 91福利社 | 四虎最新永久免费视频 | 久久桃花 | 四虎网址换成什么了2021 | 老司机午夜在线视频免费 | 九九热线有精品视频99 | 色综合久久久久久 | 欧美精品在线免费观看 | 日韩欧美一区二区久久 | 久久精品国产亚洲麻豆小说 | 一级片久久 | 欧美大尺度免费一级特黄 | 波多野结衣中文字幕久久 |