Re: Treeview (liststore) CSS question



Its not whether the row is empty, its whether it exists

On Mon, 18 Mar 2019 at 23:25, Daniel Kasak <d j kasak dk gmail com> wrote:

On Tue, Mar 19, 2019 at 3:01 AM Mike Martin via gtk-app-devel-list <
gtk-app-devel-list gnome org> wrote:

Is it possible to set different background for a treestore, with a
liststore, for populated rows v blank area.

ie: If I have a dynamic treeview I would like to have one background
colour
for the rows and another for the treestore where there are no rows

The particular example has the following tree
Grid,Notebook,grid,scrolledwindow,treeview


Use set_cell_data_func:

https://developer.gnome.org/gtk3/stable/GtkTreeViewColumn.html#gtk-tree-view-column-set-cell-data-func

You'd have to do this for every GtkTreeViewColumn you wanted to colour.
Your callback would then fetch whatever value you want to use as a test (
ie to test whether the row is 'empty' or not ), and set the renderer's
"background' property to whatever colour you're after ( the callback get's
passed the renderer ).

Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]