#!/usr/bin/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, {
	'GtkWindow::type':            WINDOW_TOPLEVEL,
	'GtkWindow::title':           'Hello World',
	'GtkWindow::allow_grow':      0,
	'GtkWindow::allow_shrink':    0,
	'GtkObject::signal::destroy': destroy,
	'GtkContainer::border_width': 10
})

button = new(GtkButton, {
	'GtkButton::label': 'Hello World',
	'GtkObject::signal::clicked': hello,
	'GtkWidget::parent': window,
	'GtkWidget::visible': 1
})

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

window.show()
mainloop()


