C.4. List Item Widget

The ListItem widget is designed to act as a container holding up to one child, providing methods for selection/deselection just like the List widget requires them for its children.

A ListItem has its own window to receive events and has its own background color which is usually white.

As it is directly derived from an Item it can be treated as such, see the Item widget for more on this. Usually a ListItem just holds a label to identify, e.g., a filename within a List -- therefore the function GtkListItem() accepts either a string to create a label or nothing to create an empty ListItem:
 
list_item = GtkListItem(text)
list_item = GtkListItem()

The same effect can be achieved by creating a Label on its own, setting its alignment to xalign=0 and yalign=0.5 with a subsequent container addition to the ListItem:
 
list_item = GtkListItem()
label = GtkLabel("ListItem Label")
label.set_alignment(0, 0.5)
list_item.add(label)

Since a GtkListItem is a GtkContainer, you could also add a GtkVBox or a GtkArrow etc. to the GtkListItem instead of a GtkLabel.