如何通过gtk.Window点击?(How to click through gtk.Window?

2019-06-26 23:58发布

像统一通知。 set_accept_focus()是不是我需要的,我没有看到的东西在gtk.gdk常量的...好像我的谷歌福失败。

Answer 1:

因此,答案是:

win.show_all()
#win.window.input_shape_combine_mask(img,0,0)
def set_mask(win):
    #b=gtk.gdk.bitmap_create_from_data(win.window,8,win.window.get_size())
    size=win.window.get_size()
    print 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)
    print 'ready'
gobject.timeout_add(5000, set_mask, win)


文章来源: How to click through gtk.Window?