ListBoxRow

A GtkListBox is a vertical container that contains GtkListBoxRow children. These rows can by dynamically sorted and filtered, and headers can be added dynamically depending on the row content. It also allows keyboard and mouse navigation and selection like a typical list.

Using GtkListBox is often an alternative to GtkTreeView, especially when the list contents has a more complicated layout than what is allowed by a GtkCellRenderer, or when the contents is interactive (i.e. has a button in it).

Although a GtkListBox must have only GtkListBoxRow children you can add any kind of widget to it via gtk_container_add(), and a GtkListBoxRow widget will automatically be inserted between the list and the widget.

The GtkListBox widget was added in GTK+ 3.10.

Constructors

this
this(GtkListBoxRow* gtkListBoxRow)

Sets our main struct and passes it to the parent class

this
this()

Creates a new GtkListBoxRow, to be used as a child of a GtkListBox.

Members

Functions

addOnActivate
void addOnActivate(void delegate(ListBoxRow) dlg, ConnectFlags connectFlags)

See Also GtkScrolledWindow

changed
void changed()

Marks row as changed, causing any state that depends on this to be updated. This affects sorting, filtering and headers. Note that calls to this method must be in sync with the data used for the row functions. For instance, if the list is mirroring some external data set, and *two* rows changed in the external data set then when you call gtk_list_box_row_changed() on the first row the sort function must only read the new data for the first of the two changed rows, otherwise the resorting of the rows will be wrong. This generally means that if you don't fully control the data model you have to duplicate the data that affects the listbox row functions into the row widgets themselves. Another alternative is to call gtk_list_box_invalidate_sort() on any model change, but that is more expensive.

getHeader
Widget getHeader()

Returns the current header of the row. This can be used in a GtkListBoxUpdateHeaderFunc to see if there is a header set already, and if so to update the state of it.

getIndex
int getIndex()

Gets the current index of the row in its GtkListBox container.

getListBoxRowStruct
GtkListBoxRow* getListBoxRowStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setHeader
void setHeader(Widget header)

Sets the current header of the row. This is only allowed to be called from a GtkListBoxUpdateHeaderFunc. It will replace any existing header in the row, and be shown in front of the row in the listbox.

Static functions

callBackActivate
void callBackActivate(GtkListBoxRow* listboxrowStruct, ListBoxRow _listBoxRow)
Undocumented in source. Be warned that the author may not have intended to support it.
getType
GType getType()

Variables

connectedSignals
int[string] connectedSignals;
gtkListBoxRow
GtkListBoxRow* gtkListBoxRow;

the main Gtk struct

onActivateListeners
void delegate(ListBoxRow)[] onActivateListeners;
Undocumented in source.

Meta