About all my projects
Gnome::Gtk4::StringFilter

Gnome::Gtk4::StringFilter

Description

Gnome::Gtk4::StringFilter determines whether to include items by comparing strings to a fixed search term.

The strings are obtained from the items by evaluating a Gnome::Gtk4::Expression set with .set-expression(), and they are compared against a search term set with .set-search().

Gnome::Gtk4::StringFilter 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().

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

new-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.

method new-stringfilter ( N-Object() $expression --> Gnome::Gtk4::StringFilter \)
  • $expression; (transfer ownership: full) The expression to evaluate.

Methods

get-expression

Gets the expression that the string filter uses to obtain strings from items.

method get-expression (--> N-Object )

Return value; a Gnome::Gtk4::Expression.

get-ignore-case

Returns whether the filter ignores case differences.

method get-ignore-case (--> Bool )

Return value; True if the filter ignores case.

get-match-mode

Returns the match mode that the filter is using.

method get-match-mode (--> GtkStringFilterMatchMode )

Return value; the match mode of the filter.

Gets the search term.

method get-search (--> Str )

Return value; 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.

method set-expression ( N-Object() $expression )
  • $expression; a Gnome::Gtk4::Expression.

set-ignore-case

Sets whether the filter ignores case differences.

method set-ignore-case ( Bool() $ignore-case )
  • $ignore-case; True to ignore case.

set-match-mode

Sets the match mode for the filter.

method set-match-mode ( GtkStringFilterMatchMode $mode )
  • $mode; the new match mode.

Sets the string to search for.

method set-search ( Str $search )
  • $search; The string to search for or undefined to clear the search.