使用Pygtk写的几个例子

源代码在线查看: simple.py

软件大小: 182 K
上传用户: junjie_x
关键词: Pygtk
下载地址: 免注册下载 普通下载 VIP

相关代码

				#!/usr/bin/env python								# translation of the simple.c test in the gtk+ distribution, using the				# new() function from gobject (this is an example of creating objects				# with the properties interface).								import gobject, gtk								def hello(*args):				    print "Hello World"				    window.destroy()								def destroy(*args):				    window.hide()				    gtk.main_quit()								window = gobject.new(gtk.Window,				                     type=gtk.WINDOW_TOPLEVEL,				                     title='Hello World',				                     allow_grow=False,				                     allow_shrink=False,				                     border_width=10)				window.connect("destroy", destroy)								button = gobject.new(gtk.Button, label="Hello World", parent=window)				button.connect("clicked", hello)								window.show_all()				gtk.main()							

相关资源