Appendix C. List Widget

NOTE: The List widget has been superseded by the CList widget. It is detailed here just for completeness.

The List widget is designed to act as a vertical container for widgets that should be of the type ListItem.

A List widget has its own window to receive events and its own background color which is usually white. As it is directly derived from a Container it can be treated as such, see the Container widget for more on this.

The selection list of a GtkList object can be retrieved using the method:
 
selection_list = gtklist.get_selection()

The selection_list is a list containing all list items that are currently selected.

The selection_mode of the gtklist determines the selection facilities of the gtklist and therefore the contents of the selection_list. The selection_mode may be one of the following defined in GTK.py):

The default is SELECTION_MULTIPLE.

C.1. Signals

selection_changed(gtklist, data)

This signal will be invoked whenever the selection_list of a gtklist has changed. This happens when a child of the gtklist got selected or deselected.
 
select_child(gtklist, child, data)

This signal is invoked when a child of the gtklist is about to get selected. This happens mainly on calls to select_item(), select_child(), button presses and sometimes indirectly triggered on some other occasions when children get added to or removed from the gtklist.
 
unselect_child(gtklist, child, data)

This signal is invoked when a child of the gtklist is about to get deselected. This happens mainly on calls to unselect_item(), unselect_child(), button presses and sometimes indirectly triggered on some other occasions when children get added to or removed from the gtklist.