`
deepfuture
  • 浏览: 4401964 次
  • 性别: Icon_minigender_1
  • 来自: 湛江
博客专栏
073ec2a9-85b7-3ebf-a3bb-c6361e6c6f64
SQLite源码剖析
浏览量:80084
1591c4b8-62f1-3d3e-9551-25c77465da96
WIN32汇编语言学习应用...
浏览量:70101
F5390db6-59dd-338f-ba18-4e93943ff06a
神奇的perl
浏览量:103411
Dac44363-8a80-3836-99aa-f7b7780fa6e2
lucene等搜索引擎解析...
浏览量:285930
Ec49a563-4109-3c69-9c83-8f6d068ba113
深入lucene3.5源码...
浏览量:15019
9b99bfc2-19c2-3346-9100-7f8879c731ce
VB.NET并行与分布式编...
浏览量:67609
B1db2af3-06b3-35bb-ac08-59ff2d1324b4
silverlight 5...
浏览量:32175
4a56b548-ab3d-35af-a984-e0781d142c23
算法下午茶系列
浏览量:46001
社区版块
存档分类
最新评论

pygtk-Statusbar

 
阅读更多



 

#!/usr/bin/env python

# example statusbar.py

import pygtk
pygtk.require('2.0')
import gtk

class StatusbarExample:
	 def push_item(self, widget, data):
		 buff = " Item %d" % self.count
		 self.count = self.count + 1
		 self.status_bar.push(data, buff)
		 return

	 def pop_item(self, widget, data):
		 self.status_bar.pop(data)
		 return

	 def __init__(self):
		 self.count = 1
		 # create a new window
		 window = gtk.Window(gtk.WINDOW_TOPLEVEL)
		 window.set_size_request(200, 100)
		 window.set_title("PyGTK Statusbar Example")
		 window.connect("delete_event", lambda w,e: gtk.main_quit())

		 vbox = gtk.VBox(False, 1)
		 window.add(vbox)
		 vbox.show()

		 self.status_bar = gtk.Statusbar()
		 vbox.pack_start(self.status_bar, True, True, 0)
		 self.status_bar.show()
		 context_id = self.status_bar.get_context_id("Statusbar example")
		 button = gtk.Button("push item")
		 button.connect("clicked", self.push_item, context_id)
		 vbox.pack_start(button, True, True, 2)
		 button.show()
		 button = gtk.Button("pop last item")
		 button.connect("clicked", self.pop_item, context_id)
		 vbox.pack_start(button, True, True, 2)
		 button.show()
		 # always display the window as the last step so it all splashes on
		 # the screen at once.
		 window.show()
def main():
	 gtk.main()
	 return 0
if __name__ == "__main__":
	 StatusbarExample()
	 main()

 

  • 大小: 28.5 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics