I am an entirely Python newbie. I have only completed Chapters 1,2,3, and 4 of the Python Tutorial by Guido
http://docs.python.org/tut/.
Now I am attempting to create a Graphical User Interface using Glade through this tutorial
http://www.learningpython.com/2006/0...gtk-and-glade/.
I have gotten through the entire GUI designing bit and I saved it. But, according to the tutorial I should have two files produced. One saved as .glade and the other .gladep. I only get one file that is of .glade extension. I did attempt to create a .py document with it. Which contains:
Code:
#!/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 HellowWorldGTK:
"""This is an Hello World GTK application"""
def __init__(self):
#Set the Glade file
self.gladefile = "pyhelloworld.glade"
self.wTree = gtk.glade.XML(self.gladefile)
#Get the Main Window, and connect the "destroy" event
self.window = self.wTree.get_widget("MainWindow")
if (self.window):
self.window.connect("destroy", gtk.main_quit)
According to the tutorial this is the code required to get the GUI started. I have made it executable using chmod +x but when I run it I get nothing. I also ran it through terminal and the terminal brefiely appears for a fraction of a second and vanishes.
I believe its because i don't have a .gladep file.
note: I noticed that I had 'frame' instead of window in my glade application possible version problem?
Though this is on Ubuntu and I ran the
Code:
apt-get install python-gtk2 python-glade2
to check if I had it and it confirmed I had these so I don't understand why some sort of version confusion would be there.
As well as,
http://www.kplug.org/glade_tutorial/...uick_tour.html states that I need two files.