Sorry for my English (I could not find help in the Russian community)
I'm trying to learn PyGTK and Glade. I made test window in Glade and
saved it as "test.glade" (attached). Then I wrote script
"test.py"(attached, http://pastebin.com/waKytam3). I tried to run it.
While the script was executed, console did not show anything and
window wasn't displayed. When I pressed CTRL+С console displayed
trackback:
---
CTraceback (most recent call last):
  File "test.py", line 32, in <module>
    gtk.main()
KeyboardInterrupt
---
So what am I doing wrong?

-- 
Best wishes,
Daniil
#!/usr/bin/env python

import sys
try:
 	import pygtk
  	pygtk.require("2.0")
except:
  	pass
try:
	import gtk
  	import gtk.glade
except:
	sys.exit(1)

class TestPyGtk:
	"""This is an Hello World GTK application"""

	def __init__(self):
		
		#Set the Glade file
		self.gladefile = "test.glade"  
	        self.wTree = gtk.glade.XML(self.gladefile) 
		
		#Create our dictionay and connect it
		dic = {"on_MainWindow_destroy" : gtk.main_quit }
		self.wTree.signal_autoconnect(dic)



if __name__ == "__main__":
	TestPyGtk = TestPyGtk()
	gtk.main()

Attachment: test.glade
Description: application/glade

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to