Package: gtk

Function gtk:text-iter-search

Lambda List

gtk:text-iter-search (iter str &key flags limit direction)

Arguments

iter -- a gtk:text-iter iterator with the start of the search
str -- a search string
flags -- a gtk:text-search-flags value with the flags affecting how the search is done
limit -- a gtk:text-iter iterator with the bound for the search, or nil for the end of the text buffer
direction -- a :forward value indicates forward search and a :backward value backward search, the default is :forward

Return Value

start -- a gtk:text-iter iterator with the start of the match
end -- a gtk:text-iter iterator with the end of the match

Details

Searches for str in the text buffer that is associated with iter. The direction of the search is indicated with the direction keyword argument which has a :forward default value for forward search. For backward search the direction argument takes the :backward value. The flags and limit arguments are keyword arguments with a nil default value.

Any match is returned by returning start to the first character of the match and end to the first character after the match. The search will not continue past limit. Note that a search is a linear or O(n) operation, so you may wish to use limit to avoid locking up your UI on large text buffers.

The start value will never be set to an iterator located before iter, even if there is a possible end after or at iter.

Notes

This function combines the gtk_text_iter_forward_search() and gtk_text_iter_backward_search() functions into one function.
 

See also

2024-7-1