I'm getting an attribute error trying to call anything on the Event object
passed to me. I tried dumping a __dict__ and that isn't there either.
The wrapper doesn't make SENSE, in any case. The logic of get_coords would be
that a python method call was modifying its (integer) arguments, which is
remarkably un-pythonic. (Pass it a mutable list, sure. But that's not what
it claims should be happening.) Maybe the C bindings can do this, but ouch.
Here's some sample code showing things I've tried, which didn't work.
Rob
--
penguicon.sf.net - A combination Linux Expo and Science Fiction Convention,
May 2-4 2003 in Warren, Michigan. Tutorials, installfest, filk, masquerade...
#!/usr/bin/python
import gtk,gtk.gdk, sys
class blah:
def button_press_event(self, a, b):
print a,b
w=x=y=0
print b.get_state
print b.get_state(w)
print b.get_coords
print b.coords
print gtk.gdk.get_coords(b,x,y)
def __init__(self):
self.window=gtk.Window()
self.window.connect("delete_event",lambda a: sys.exit(0))
self.window.set_border_width(10)
self.event_box=gtk.EventBox()
self.window.add(self.event_box)
self.event_box.show()
self.label=gtk.Label("Click here to quit, quit, quit, quit")
self.event_box.add(self.label)
self.label.show()
self.label.set_size_request(110,20)
self.event_box.set_events(gtk.gdk.BUTTON_PRESS_MASK)
self.event_box.connect("button_press_event",self.button_press_event)
self.event_box.realize()
#self.event_box.set_cursor(gtk.cursor_new(gtk.gdk.HAND1))
self.window.show()
if __name__=="__main__":
blah()
while gtk.mainiteration(): pass