3

就像在统一通知上一样。set_accept_focus() 不是我需要的,而且我在 gtk.gdk 常量中看不到有用的东西......似乎我的 google-fu 失败了。

4

1 回答 1

7

所以,答案是:

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)
于 2012-08-11T19:54:20.893 回答