我试图通过连接到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,而不呈现红色叠加层。