GTK+ 1.2 Tutorial
Prev | Appendix D. List Widget | Next

# List Item Widget

The ListItem widget is designed to act as a container holding up to one child, providing functions 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 by using the GTK_ITEM(ListItem) macro, 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 convenience function gtk_list_item_new_with_label() is provided. 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.

As one is not forced to add a GtkLabel to a GtkListItem, you could also add a GtkVBox or a GtkArrow etc. to the GtkListItem.

Prev | Home | Next
Example | Up | Signals