开罗不在GtkTreeView上绘图

时间:2019-09-12 01:01:16

标签: gtk gtk3

我试图通过连接到draw信号在带有开罗的GtkTreeView上绘制。

此代码非常适合GtkBox,它在其上绘制了一个红色矩形:

box.setApplicationPaintable(true);
box.connect("draw", (GUserFunctionCallback) (self, target, data) -> {
    GtkAllocation allocation = tree.getAllocation();
    new CairoContext(target).newOperation()
            .setColor(255,0,0)
            .addRectangle(0, 0, allocation.width, allocation.height)
            .fill();
});

但是当我将GtkTreeView与上面相同的代码一起使用时,它仅呈现TreeView,而不呈现红色叠加层。

0 个答案:

没有答案