0

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.

Kavaeric
  • 43
  • 1
  • 6
  • A good way to find out is to use the GTK inspector (ctrl+shift+I or ctrl+shift+D.) In GTK 3.20 this becomes a lot easier as the CSS node names are listed in the documentation. – ptomato Nov 15 '16 at 04:36
  • @ptomato that worked, I managed to figure it out! Thank you. – Kavaeric Nov 15 '16 at 18:03

1 Answers1

3

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.

Kavaeric
  • 43
  • 1
  • 6