是的,我创建了可以点击的窗口(感谢 irc.gnome.org 的#gtk+),现在 - 如何让它听到 -mouse_over
事件?那么,我们究竟做了什么:
def set_mask(win):
size=win.window.get_size()
bitmap=gtk.gdk.Pixmap(win.window,size[0],size[1],1)
cr = bitmap.cairo_create()
cr.set_operator(cairo.OPERATOR_SOURCE)
cr.set_source_rgba(0.0,0.0,0.0,0.0)
cr.rectangle((0,0)+size)
cr.fill()
win.window.input_shape_combine_mask(bitmap,0,0)