#!/usr/bin/python
# -*- coding: utf-8 -*-

import gtk
import gobject
from lxml import etree
from StringIO import StringIO

def destroy (*args):
	print "Destroy..."
	gtk.main_quit()
	print "Destroyed"
	
def main ():
	print "lxml.etree:       ", etree.LXML_VERSION
	print "libxml used:      ", etree.LIBXML_VERSION
	print "libxml compiled:  ", etree.LIBXML_COMPILED_VERSION
	print "libxslt used:     ", etree.LIBXSLT_VERSION
	print "libxslt compiled: ", etree.LIBXSLT_COMPILED_VERSION

	window = gtk.Window()
	window.connect("destroy", destroy)
	window.show_all()
	
	etree.parse(StringIO("<root>data</root>"))
	
	gobject.threads_init() 
	gtk.main()
	print "Now after the GTK-Main ... So the main has finished"

if __name__ == "__main__":
	main()

