VisibleFunc


Description:

public delegate bool VisibleFunc (Item item)

A Granite.Widgets.SourceList.VisibleFunc should return true if the item should be visible; false otherwise. If item's Granite.Widgets.SourceList.Item.visible property is set to false, then it won't be displayed even if this method returns true.

It is important to note that the method must not modify any property of item. Doing so would result in an infinite loop, freezing the application's user interface. This happens because the source list invokes this method to "filter" an item after any of its properties changes, so by modifying a property this method would be invoking itself again.

For most use cases, modifying the Granite.Widgets.SourceList.Item.visible property is enough.

The advantage of using this method is that its nature is non-destructive, and the changes it makes can be easily reverted (see Granite.Widgets.SourceList.refilter).

Parameters:

item

Item to be checked.

Returns:

Whether item should be visible or not.

Since:

0.2




2022 vala-language.org