#!/usr/bin/env python

# translation of "Hello World III" from gtk manual, using the new() function
# from Gtkinter

from Gtkinter import *

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

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

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
})

window.show()
mainloop()

