GtkSource.SearchSettings

g GObject.Object GObject.Object GtkSource.SearchSettings GtkSource.SearchSettings GObject.Object->GtkSource.SearchSettings

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new ()
  get_at_word_boundaries ()
  get_case_sensitive ()
  get_regex_enabled ()
  get_search_text ()
  get_wrap_around ()
  set_at_word_boundaries (at_word_boundaries)
  set_case_sensitive (case_sensitive)
  set_regex_enabled (regex_enabled)
  set_search_text (search_text)
  set_wrap_around (wrap_around)

Virtual Methods

Inherited:GObject.Object (7)

Properties

Name Type Flags Short Description
at-word-boundaries bool r/w/c Search at word boundaries
case-sensitive bool r/w/c Case sensitive
regex-enabled bool r/w/c Whether to search by regular expression
search-text str r/w/c The text to search
wrap-around bool r/w/c Wrap around

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

Class Details

class GtkSource.SearchSettings(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:GtkSource.SearchSettingsClass
classmethod new()
Returns:a new search settings object.
Return type:GtkSource.SearchSettings

Creates a new search settings object.

New in version 3.10.

get_at_word_boundaries()
Returns:whether to search at word boundaries.
Return type:bool

New in version 3.10.

get_case_sensitive()
Returns:whether the search is case sensitive.
Return type:bool

New in version 3.10.

get_regex_enabled()
Returns:whether to search by regular expressions.
Return type:bool

New in version 3.10.

get_search_text()
Returns:the text to search, or None if the search is disabled.
Return type:str or None

Gets the text to search. The return value must not be freed.

You may be interested to call GtkSource.utils_escape_search_text() after this function.

New in version 3.10.

get_wrap_around()
Returns:whether to wrap around the search.
Return type:bool

New in version 3.10.

set_at_word_boundaries(at_word_boundaries)
Parameters:at_word_boundaries (bool) – the setting.

Change whether the search is done at word boundaries. If at_word_boundaries is True, a search match must start and end a word. The match can span multiple words. See also Gtk.TextIter.starts_word() and Gtk.TextIter.ends_word().

New in version 3.10.

set_case_sensitive(case_sensitive)
Parameters:case_sensitive (bool) – the setting.

Enables or disables the case sensitivity for the search.

New in version 3.10.

set_regex_enabled(regex_enabled)
Parameters:regex_enabled (bool) – the setting.

Enables or disables whether to search by regular expressions. If enabled, the GtkSource.SearchSettings :search-text property contains the pattern of the regular expression.

GtkSource.SearchContext uses GLib.Regex when regex search is enabled. See the Regular expression syntax page in the GLib reference manual.

New in version 3.10.

set_search_text(search_text)
Parameters:search_text (str or None) – the nul-terminated text to search, or None to disable the search.

Sets the text to search. If search_text is None or is empty, the search will be disabled. A copy of search_text will be made, so you can safely free search_text after a call to this function.

You may be interested to call GtkSource.utils_unescape_search_text() before this function.

New in version 3.10.

set_wrap_around(wrap_around)
Parameters:wrap_around (bool) – the setting.

Enables or disables the wrap around search. If wrap_around is True, the forward search continues at the beginning of the buffer if no search occurrences are found. Similarly, the backward search continues to search at the end of the buffer.

New in version 3.10.

Property Details

GtkSource.SearchSettings.props.at_word_boundaries
Name:at-word-boundaries
Type:bool
Default Value:False
Flags:READABLE, WRITABLE, CONSTRUCT

If True, a search match must start and end a word. The match can span multiple words.

New in version 3.10.

GtkSource.SearchSettings.props.case_sensitive
Name:case-sensitive
Type:bool
Default Value:False
Flags:READABLE, WRITABLE, CONSTRUCT

Whether the search is case sensitive.

New in version 3.10.

GtkSource.SearchSettings.props.regex_enabled
Name:regex-enabled
Type:bool
Default Value:False
Flags:READABLE, WRITABLE, CONSTRUCT

Search by regular expressions with GtkSource.SearchSettings :search-text as the pattern.

New in version 3.10.

GtkSource.SearchSettings.props.search_text
Name:search-text
Type:str
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT

A search string, or None if the search is disabled. If the regular expression search is enabled, GtkSource.SearchSettings :search-text is the pattern.

New in version 3.10.

GtkSource.SearchSettings.props.wrap_around
Name:wrap-around
Type:bool
Default Value:False
Flags:READABLE, WRITABLE, CONSTRUCT

For a forward search, continue at the beginning of the buffer if no search occurrence is found. For a backward search, continue at the end of the buffer.

New in version 3.10.