Gtk-- Reference: Gtk::List

Class Index | Cross Index | Namespace Index

# Class Gtk::List

Widget for packing a list of selectable items.
Contained in: Gtk
Derived from: Gtk::Container
Derived by: none

#include <gtk--/list.h>

### public function member index:
`` | `List` | `()`;
``void`` | `append_items` | `(`GList`* `items`)`;
``gint`` | `child_position` | `(`Widget`& `child`)`;
``void`` | `clear_items` | `(`gint` `start`, `gint` `end`)`;
``GtkList`*` | `gtkobj` | `()`;
``const` `GtkList`*` | `gtkobj` | `() `const``;
``void`` | `insert_items` | `(`GList`* `items`, `gint` `position`)`;
``static` `bool`` | `isA` | `(`Object`* `object`)`;
`ItemList&` | `items` | `()`;
``const` ItemList&` | `items` | `() `const``;
``void`` | `prepend_items` | `(`GList`* `items`)`;
``void`` | `remove_items` | `(`GList`* `items`)`;
``void`` | `remove_items_no_unref` | `(`GList`* `items`)`;
``emitable` `signal` `void`` | `select_child` | `(`Widget`&)`;
``void`` | `select_item` | `(`gint` `item`)`;
`SelectionList&` | `selection` | `()`;
``const` SelectionList&` | `selection` | `() `const``;
``signal` `void`` | `selection_changed` | `()`;
``void`` | `set_selection_mode` | `(`GtkSelectionMode` `mode`)`;
``emitable` `signal` `void`` | `unselect_child` | `(`Widget`&)`;
``void`` | `unselect_item` | `(`gint` `item`)`;
``virtual`` | `~List` | `()`;
### protected function member index:
``virtual` `void`` | `select_child_impl` | `(`Widget`& `p0`)`;
``virtual` `void`` | `selection_changed_impl` | `()`;
``virtual` `void`` | `unselect_child_impl` | `(`Widget`& `p0`)`;

## Description:

The `Gtk::List` widget is a container whose children are displayed vertically in order, and can be selected. The list has many selection modes, which are programmer selective and depend on how many elements are able to be selected at the same time.

## Function Member Descriptions:

Gtk::List::append_items - Adds items to the end of the list.

``void`` `append_items``(`GList`* `items`)`;

> items: The items.

Gtk::List::child_position - Searches the children of list for the index of child.

``gint`` `child_position``(`Widget`& `child`)`;

> child: The child to look for.

> Returns: The index of the child, -1 if not found.

Gtk::List::clear_items - Removes the items between index start (included) and end (excluded) from the list.

``void`` `clear_items``(`gint` `start`, `gint` `end`)`;

> If end is negative, or greater than the number of children of list, it's assumed to be exactly the number of elements. If start is greater than or equal to end, nothing is done.

> start: The index of the first item to remove.

> end: The index of the lest item to remove plus one.

Gtk::List::gtkobj - Returns the underlaying gtk+ object.

``GtkList`*` `gtkobj``()`;
Gtk::List::insert_items - Inserts items into the list at the position position.

``void`` `insert_items``(`GList`* `items`, `gint` `position`)`;

> items: The items. position: The position to insert items, starting at 0.

Gtk::List::isA - Returns true if object is this type.

``static` `bool`` `isA``(`Object`* `object`)`;
Gtk::List::prepend_items - Inserts items at the beginning of the list.

``void`` `prepend_items``(`GList`* `items`)`;

> items: The items.

Gtk::List::remove_items - Removes the items from the list.

``void`` `remove_items``(`GList`* `items`)`;

> items: The items to remove.

Gtk::List::remove_items_no_unref - Removes the items from the list, without unreferencing them. It may be useful if you want to move the items from one list to another.

``void`` `remove_items_no_unref``(`GList`* `items`)`;

> items: The items.

Gtk::List::select_child - The child widget has just been selected.

``emitable` `signal` `void`` `select_child``(`Widget`&)`;
``virtual` `void`` `select_child_impl``(`Widget`& `p0`)`;
Gtk::List::select_item - Selects the child number item of the list.

``void`` `select_item``(`gint` `item`)`;

> Nothing happens if item is out of bounds. The signal {Gtk::List::select-child} will be emitted.

> item: The index of the child to select.

Gtk::List::selection_changed - The selection of the widget has just changed.

``signal` `void`` `selection_changed``()`;
``virtual` `void`` `selection_changed_impl``()`;
Gtk::List::set_selection_mode - Set the list selection mode.

``void`` `set_selection_mode``(`GtkSelectionMode` `mode`)`;

> The selection mode can be any value in ``Gtk::SelectionMode``:

> `GTK_SELECTION_SINGLE`: Zero or one element may be selected.

> `GTK_SELECTION_BROWSE`: Exactly one element is always selected (this can be false after you have changed the selection mode).

> `GTK_SELECTION_MULTIPLE`: Any number of elements may be selected. Clicks toggle the state of an item.

> `GTK_SELECTION_EXTENDED`: Any number of elements may be selected. Click-drag selects a range of elements; the Ctrl key may be used to enlarge the selection, and Shift key to select between the focus and the child pointed to.

> mode: The new selection mode.

Gtk::List::unselect_child - The child widget has just been unselected.

``emitable` `signal` `void`` `unselect_child``(`Widget`&)`;
``virtual` `void`` `unselect_child_impl``(`Widget`& `p0`)`;
Gtk::List::unselect_item - Unselects the child number item of the list.

``void`` `unselect_item``(`gint` `item`)`;

> Nothing happens if item is out of bounds. The signal {Gtk::List::unselect-child} will be emitted.

> item: The index of the child to unselect.