#!/usr/bin/env python

# translation of "Hello World III" from GTK manual, using new() function
# from Gtkinter.  Also implements a tooltip for the button.

from Gtkinter import *

def hello(*args):
	print "Hello World"
	window.destroy()

def destroy(*args):
	window.hide()
	mainquit()

tt = GtkTooltips()
tt.set_delay(500)

window = new(GtkWindow, type=WINDOW_TOPLEvEL, title="Hello World",
	     allow_grow=FALSE, allow_shrink=FALSE, border_width=10)
window.connect("destroy", destroy)

button = new(GtkButton, label="Hello World", parent=window, visible=TRUE)
button.connect("clicked", hello)

tt.set_tip(button, 'Prints "Hello World"', '')
tt.enable()

window.show()
mainloop()


