Changing the selected item colour in a GtkTreeview using python

后端 未结 5 1529
别那么骄傲
别那么骄傲 2021-01-18 07:57

I have a dialog which contains a pygtk.treeview for listing tasks by priority. Each row has the background colour set based on that priority, so for example the highest prio

5条回答
  •  情话喂你
    2021-01-18 08:34

    Not sure what you mean by flickering. A border would require subclassing TreeView.

    I'd make the STATE_SELECTED color identical to STATE_NORMAL to disable the built-in highlighting. Then set a data_func on each column and change some color on the cell renderer depending on whether it's in the selection or not.

    You're probably already doing this for your priority, so just multiply the color with something to highlight a row.

提交回复
热议问题