Package: gtk

Function gtk-list-box-set-header-func

Lambda List

gtk-list-box-set-header-func (listbox func)

Arguments

listbox -- a gtk-list-box widget
func -- a gtk-list-box-update-header-func callback function that lets you add row headers

Details

By setting a header function on the list box one can dynamically add headers in front of rows, depending on the contents of the row and its position in the list box. 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 func callback function can look at the current header widget using the gtk-list-box-row-header function and either update the state of the widget as needed, or set a new one using the (setf gtk-list-box-row-header) function. If no header is needed, set the header to nil.

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

The func callback function will be called for each row after the call, and it will continue to be called each time a row changes via the gtk-list-box-row-changed function, and when the row before changes either by the gtk-list-box-row-changed function on the previous row, or when the previous row becomes a different row. It is also called for all rows when the gtk-list-box-invalidate-headers function is called.
 

See also

2021-11-15