After messing with glade for a good bit, I have no idea how to get it to do what I want it to do. I want to create the parent window, and add things to it, similar to Microsoft's visual designer. Is this possible? Or am I missing the ideology behind what this program does. Looking for some guidance
EDIT: Finally figured that out, but now just to connect everything. Any good ideas or samples of python code that connects the GUI/handlers to the actual code?
Just trying to get some output, from a tutorial I have this code:
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 = "Derp.glade"
self.wTree = gtk.glade.XML(self.gladefile)
#Create our dictionay and connect it
dic = { "on_button1_clicked" : self.button1_clicked,
"on_MainWindow_destroy" : gtk.main_quit }
self.wTree.signal_autoconnect(dic)
def button1_clicked(self, widget):
print "Hello World!"
if __name__ == "__main__":
hwg = HellowWorldGTK()
gtk.main()
In my form I have the signal linked to call the right functions, am I doing something obviously wrong?
Also noticing I don't have this XML file, I guess Glade didn't make it when I saved my .glade?
Edited by Analog, 26 June 2010 - 10:30 AM.