Originally Posted by
felipe
why is this bad for your needs. SimpleGladeApp.py is just one small python class,
which loads the glade.xml file and auto-connects the signals ...
Code:
29 class SimpleGladeApp(dict):
30 def __init__(self, glade_filename, main_widget_name=None, domain=None):
31 gtk.glade.set_custom_handler(self.custom_handler)
32 if os.path.isfile(glade_filename):
33 self.glade_path = glade_filename
34 else:
35 glade_dir = os.path.split( sys.argv[0] )[0]
36 self.glade_path = os.path.join(glade_dir, glade_filename)
37 self.glade = gtk.glade.XML(self.glade_path, main_widget_name, domain)
38 if main_widget_name:
39 self.main_widget = self.glade.get_widget(main_widget_name)
40 else:
41 self.main_widget = None
42 self.signal_autoconnect()
43 self.new()
the important line is
37 self.glade = gtk.glade.XML(self.glade_path, main_widget_name, domain)
where the glade.xml file is loaded. i've just started to do a little python and i find the SimpleGladeApp rather usefull. there is no magic involved
Bookmarks