I was reading about builder.connect_signals which maps handlers of glade files with methods in your python file. Apparently works, except for the Main Window, which is not destroying when you close it. If you run it from terminal is still running and have to Ctrl-C to completely close the application.
Here is my python code:
#!/usr/bin/env python
import pygtk
import gtk
#from gi.repository import Gtk
import gtk.glade
class Mixer:
def __init__(self):
self.gladefile = "mixer3.glade"
self.wTree = gtk.Builder()
self.wTree.add_from_file(self.gladefile)
window = self.wTree.get_object("window1")
#if (window):
# window.connect("destroy", gtk.main_quit)
#line_btn = self.wTree.get_object("toggle_linein")
#line_btn.connect("on_toggle_linein_activate", btn_linein_activated)
self.wTree.connect_signals(self)
window.show_all() # must have!
def on_toggle_linein_clicked(self, widget):
print "Clicked"
def Destroy(self, obj):
gtk.main_quit()
if __name__ == "__main__":
m = Mixer()
gtk.main()