After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 512851 - gtk.gdk.Window.add_filter cannot apply to all windows
gtk.gdk.Window.add_filter cannot apply to all windows
Status: RESOLVED DUPLICATE of bug 346280
Product: pygtk
Classification: Bindings
Component: gdk
unspecified
Other All
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2008-01-29 17:46 UTC by Thomas Thurman
Modified: 2008-01-29 17:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Thomas Thurman 2008-01-29 17:46:53 UTC
In the C API, gdk_window_add_filter() allows you to pass NULL as the window parameter in order to receive *all* events for *all* windows. There is apparently no way to do this in pygtk. The obvious solution:

#!/usr/bin/python

import gtk

def frogs(event):
  print 'I have frogs!'

gtk.gdk.Window.add_filter(None, frogs)
gtk.main()

produces:

    gtk.gdk.Window.add_filter(None, frogs)
TypeError: descriptor 'add_filter' requires a 'gtk.gdk.Window' object but received a 'NoneType'
Comment 1 Johan (not receiving bugmail) Dahlin 2008-01-29 17:50:51 UTC

*** This bug has been marked as a duplicate of 346280 ***