StringFilter#
GtkStringFilter determines whether to include items by comparing
strings to a fixed search term.
The strings are obtained from the items by evaluating a GtkExpression
set with set_expression, and they are
compared against a search term set with set_search.
GtkStringFilter has several different modes of comparison - it
can match the whole string, just a prefix, or any substring. Use
set_match_mode choose a mode.
It is also possible to make case-insensitive comparisons, with
set_ignore_case.
Constructors#
- class StringFilter
- classmethod new(expression: Expression | None = None) StringFilter#
Creates a new string filter.
You will want to set up the filter by providing a string to search for and by providing a property to look up on the item.
- Parameters:
expression – The expression to evaluate
Methods#
- class StringFilter
- get_expression() Expression | None#
Gets the expression that the string filter uses to obtain strings from items.
- get_match_mode() StringFilterMatchMode#
Returns the match mode that the filter is using.
- set_expression(expression: Expression | None = None) None#
Sets the expression that the string filter uses to obtain strings from items.
The expression must have a value type of
str.- Parameters:
expression – a
GtkExpression
- set_ignore_case(ignore_case: bool) None#
Sets whether the filter ignores case differences.
- Parameters:
ignore_case –
Trueto ignore case
- set_match_mode(mode: StringFilterMatchMode) None#
Sets the match mode for the filter.
- Parameters:
mode – the new match mode
Properties#
- class StringFilter
- props.expression: Expression#
The type of the None singleton.
- props.match_mode: StringFilterMatchMode#
The type of the None singleton.