Hi,
I don't know if this is normal behaviour or a bug in (Py)Gtk, so I post it
first here.
This is a simple test app
#Start of application
import gtk
class class1():
def __init__(self):
print "INIT"
builder = gtk.Builder()
builder.add_from_file("gtk-builder-test.ui")
builder.get_object("window1").show()
builder.connect_signals(self)
c2 = class2()
builder.connect_signals(c2)
gtk.main()
print "QUITTED"
def onDeleteEvent(self, wnd, test):
print "CLASS 1"
gtk.main_quit()
class class2():
def __init__(self):
print "INIT2"
def onDeleteEvent(self, wnd, test):
print "CLASS 2"
c = class1()
# End of application
# Start of gtk-builder-test.ui
<?xml version="1.0"?>
<!--Generated with glade3 3.4.5 on Wed Jun 25 18:34:34 2008 -->
<interface>
<object class="GtkWindow" id="window1">
<signal handler="onDeleteEvent" name="delete_event"/>
<child>
<placeholder/>
</child>
</object>
</interface>
# End of gtkbuilder file
Expected behaviour (and output on console)
INIT
INIT2
# Now I click on the windows' close button
CLASS 1
CLASS 2
QUITTED
But for some reason class2.onDeleteEvent is not called
It seems that calling builder.connect_signals(object) doesn't have any
effect.
Greetings,
Nathan
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/