Gtk.StringFilter¶
class — extends Filter
Determines whether to include items by comparing strings to a fixed search term.
The strings are obtained from the items by evaluating an expression
set with StringFilter.set_expression, and they are
compared against a search term set with StringFilter.set_search.
GtkStringFilter has several different modes of comparison - it
can match the whole string, just a prefix, or any substring. Use
StringFilter.set_match_mode choose a mode.
It is also possible to make case-insensitive comparisons, with
StringFilter.set_ignore_case.
Constructors¶
new¶
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¶
get_expression¶
Gets the expression that the string filter uses to obtain strings from items.
get_ignore_case¶
Returns whether the filter ignores case differences.
get_match_mode¶
Returns the match mode that the filter is using.
get_search¶
Gets the search term.
set_expression¶
Sets the expression that the string filter uses to obtain strings from items.
The expression must have a value type of G_TYPE_STRING.
Parameters:
expression— the expression
set_ignore_case¶
Sets whether the filter ignores case differences.
Parameters:
ignore_case— true to ignore case
set_match_mode¶
Sets the match mode for the filter.
Parameters:
mode— the new match mode
set_search¶
Sets the string to search for.
Parameters:
search— the string to search for
Properties¶
expression¶
The expression to evaluate on each item to get a string to compare with.
ignore_case¶
If matching is case sensitive.
match_mode¶
If exact matches are necessary or if substrings are allowed.
search¶
The search term.