Styling list row with CSS in GTK+3

1.4k Views Asked by At

My Python app has a ListBox with some placeholder rows in them right now.

for i in range(0, 10):
    myListRow = Gtk.ListBoxRow()
    myList.add(myListRow)

    myListItem = Gtk.Box(name="MyListItem", orientation=Gtk.Orientation.HORIZONTAL)
    myListRow.add(Gtk.Label(label="placeholder"))

I'm running into a tonne of trouble styling the rows in any way. Using an arbitrary background colour, none of these result in any changes:

.list row {
    background: #f00;
}

-

.row {
    background: #f00;
}

-

row {
    background: #f00;
}

-

GtkListBox row {
    background: #f00;
}

For some reason, this does, though, and only with the area of the ListBox that has labels in it:

.list > * {
    background: #f00;
}

Testing with .list .label { background: #0f0 } confirms that it's not just styling the labels. The rows are certainly in the ListBox and can certainly be styled, but I do not have any idea what the CSS selectors for those ListBox rows might be. Any help would be appreciated.

Using PyGI running GTK+3.18 in Python 3.4.

1

There are 1 best solutions below

0
On BEST ANSWER

I forced the GTK debugger/inspector to run by adding "GTK_DEBUG" into my System Variables with the value "interactive" to look.

The name of the row element is actually list-row.