PyGTK, libglade, and signal_autoconnect

R

rocco.rossi

I was having a real hard time trying to accomplish something. I
couldn't find a way to automatically connect the "close" button
(clicked signal) of a GUI app I was working on, to the gtk.main_quit()
function. I had entered this handler directly with the GLADE-3
designer (I DON'T WANT TO USE A DICTIONARY, because I think that,
using GLADE, I should be able to shortcut that procedure) but in my
class the

self.wtree.signal_autoconnect(self)

wasn't working. Of course, I thought, it's looking for gtk.main_quit()
which is obviously somewhere else. So, the only solution I could think
of was to add:

self.wtree.signal_autoconnect(gtk) --- having already imported gtk,
naturally!

This automagically worked.

What I would like to know is if this is legitimate, and the right way
to go. It is basically a solution I cooked up instinctively, which
happened to work, but perhaps I am unaware of some other more
"orthodox" way of doing it.

Thank you.

Rock
 

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

Similar Threads

PyGTK, Glade/libglade. What am I doing wrong? 0
libglade for python-2 0
pygtk - icons? 0
Pygtk, libglade 2
pygtk + threading.Timer 1
PyGTK install 4
pygtk and threading 0
[help] how to install pygtk 0

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top