[pygtk] faq 23.34 How can I use gtk.binding_entry_add
Paul Malherbe
paul at tartan.co.za
Fri Jun 23 15:25:41 WST 2006
Hi all
Please could someone help me with this problem.
Why does the following script, as per the faq, work under linux but not
under windows.
------------------------------------------------------------------------------------------------------------------
import sys
import pygtk
if sys.platform != "win32": pygtk.require("2.0")
import gtk, gobject
class MyWindow(gtk.Window):
__gsignals__ = dict(\
mywindo=(gobject.SIGNAL_RUN_LAST|gobject.SIGNAL_ACTION,None,(str,)))
gtk.binding_entry_add_signal(\
MyWindow, gtk.keysyms.Escape, 0, 'mywindo', str, 'Escape')
def exit(*args):
sys.exit()
win = MyWindow()
win.connect("mywindo", exit)
win.show_all()
gtk.main()
------------------------------------------------------------------------------------------------------------------
Under windows I get the following:
Traceback (most recent call last):
File "test.py", line 17, in ?
win.connect("mywindo", exit)
TypeError: unknown signal name
I am using gtk+ 2.6.10 and pygtk-2.6.3 on windows 98 but have also tried
it with xp.
Thanks for any help.
Paul Malherbe
More information about the pygtk
mailing list