开发者

GTK# TreeView First row colored

开发者 https://www.devze.com 2023-03-23 03:01 出处:网络
Iam can\'t get my head around this problem. I got TreeView control and I want to color first row. Could anyone tell me how to do that ?! Playing around with cellrenderer colors whole column and can\'t

Iam can't get my head around this problem. I got TreeView control and I want to color first row. Could anyone tell me how to do that ?! Playing around with cellrenderer colors whole column and can't force it to color single row开发者_开发百科.

I would appreceiate any help


If what you are looking for is to have alternating row colors, you can affect this by setting RulesHint=true for the treeview.

If instead you are just looking to affect the background color of a single row, you will probably have to use the cell renderers and bind some attributes. For example, CellRendererText has a few different ways to set the background color, and you can bind any of those properties to a column in your model/store to control the color behind the text in that cell.

You don't just set the color on the CellRenderer, you bind it to a model column so that you can set the color in that column for each row individually.

0

精彩评论

暂无评论...
验证码 换一张
取 消