OK, I lied, I do have another question...

A

Anthony Papillion

Hi Everyone,

So I've used Glade to build a simple UI and I'm loading it with
gtkBuilder. The UI loads fine but, for some reason, none of my signals
are being connected. For example, in Glade, I said when the button
called btnExit was clicked, execute the btnExit_clicked method. Then, in
my App() class definition, I defined btnExit_clicked(self, widget) and
simply added the gtk.main_quit() statement (to exit). But when I start
my app, I am told that the btnExit_clicked() method isn't defined. This
happens for every single signal I define.

I'm assuming I'm simply putting something in the wrong place so can
anyone have a look at this and tell me what that might be? It looks
almost identical to examples I've seen on the net. Thanks!

CODE:

class App:
def __init__(self):
builder = gtk.Builder()
builder.add_from_file('bcbackup.ui')
builder.connect_signals({"on_window_destroy" : gtk.main_quit,
"on_btnExit_clicked" : btnExit_clicked})
self.window = builder.get_object("winMain")
self.window.show()

def btnSaveInformation_clicked(self, widget):
pass

def btnExit_clicked(self, widget):
gtk.main_quit()

if __name__ == "__main__":
myApp = App()
gtk.main()

END CODE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top