set_header_func


Description:

public void set_header_func (owned ListBoxUpdateHeaderFunc? update_header)

Sets a header function.

By setting a header function on the this one can dynamically add headers in front of rows, depending on the contents of the row and its position in the list.

For instance, one could use it to add headers in front of the first item of a new kind, in a list sorted by the kind.

The update_header can look at the current header widget using [[email protected]_header] and either update the state of the widget as needed, or set a new one using [[email protected]_header]. If no header is needed, set the header to null.

Note that you may get many calls update_header to this for a particular row when e.g. changing things that don’t affect the header. In this case it is important for performance to not blindly replace an existing header with an identical one.

The update_header function will be called for each row after the call, and it will continue to be called each time a row changes (via [[email protected]]) and when the row before changes (either by [[email protected]] on the previous row, or when the previous row becomes a different row). It is also called for all rows when [[email protected]_headers] is called.

Parameters:

this

a `GtkListBox`

update_header

callback that lets you add row headers

destroy

destroy notifier for user_data

user_data

user data passed to update_header




2022 vala-language.org