1.191 <GtkStringFilter>

Class: <GtkStringFilter>

It derives from <GtkFilter>.

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 string-filter:set-expression, and they are compared against a search term set with string-filter:set-search.

<GtkStringFilter> has several different modes of comparison - it can match the whole string, just a prefix, or any substring. Use string-filter:set-match-mode choose a mode.

It is also possible to make case-insensitive comparisons, with string-filter:set-ignore-case.

Properties

Property: string-filter:expression self

The expression to evaluate on each item to get a string to compare with.

Its value is a <GtkExpression>, or #f.

Set it with (set! (string-filter:expression self) value).

Property: string-filter:ignore-case self

If matching is case sensitive.

Its value is a boolean.

Set it with (set! (string-filter:ignore-case self) value).

Property: string-filter:match-mode self

If exact matches are necessary or if substrings are allowed.

Its value is a <GtkStringFilterMatchMode> (or, to set it, one of its symbols).

Set it with (set! (string-filter:match-mode self) value).

Property: string-filter:search self

The search term.

Its value is a string, or #f.

Set it with (set! (string-filter:search self) value).

Procedures

Method: string-filter:get-expression self ⇒ %return
Method: get-expression self ⇒ %return

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

self

Passed: a <GtkStringFilter>.

a string filter

%return

Returned: a <GtkExpression>, or #f.

the expression

Method: string-filter:get-ignore-case? self ⇒ %return
Method: get-ignore-case? self ⇒ %return

Returns whether the filter ignores case differences.

self

Passed: a <GtkStringFilter>.

a string filter

%return

Returned: a boolean.

true if the filter ignores case

Method: string-filter:get-match-mode self ⇒ %return
Method: get-match-mode self ⇒ %return

Returns the match mode that the filter is using.

self

Passed: a <GtkStringFilter>.

a string filter

%return

Returned: a <GtkStringFilterMatchMode>.

the match mode of the filter

Method: string-filter:get-search self ⇒ %return
Method: get-search self ⇒ %return

Gets the search term.

self

Passed: a <GtkStringFilter>.

a string filter

%return

Returned: a string, or #f.

the search term

Procedure: string-filter:new [expression] ⇒ %return

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.

expression

Passed, or left out: a <GtkExpression>, or #f.

the expression to evaluate

%return

Returned: a <GtkStringFilter>.

a new <GtkStringFilter>

Method: string-filter:set-expression self [expression]
Method: set-expression self [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.

self

Passed: a <GtkStringFilter>.

a string filter

expression

Passed, or left out: a <GtkExpression>, or #f.

the expression

Method: string-filter:set-ignore-case self ignore-case
Method: set-ignore-case self ignore-case

Sets whether the filter ignores case differences.

self

Passed: a <GtkStringFilter>.

a string filter

ignore-case

Passed: a boolean.

true to ignore case

Method: string-filter:set-match-mode self mode
Method: set-match-mode self mode

Sets the match mode for the filter.

self

Passed: a <GtkStringFilter>.

a string filter

mode

Passed: a <GtkStringFilterMatchMode>, or one of its symbols.

the new match mode

Method: string-filter:set-search self [search]
Method: set-search self [search]

Sets the string to search for.

self

Passed: a <GtkStringFilter>.

a string filter

search

Passed, or left out: a string, or #f.

the string to search for