It derives from <GtkWidget>.
A single-line text entry widget for use as a search entry.
The main API for interacting with a
<GtkSearchEntry> as entry is the
<GtkEditable> interface.
It will show an inactive symbolic “find” icon when the search entry is empty, and a symbolic “clear” icon when there is text. Clicking on the “clear” icon will empty the search entry.
To make filtering appear more reactive, it is a good idea to not react
to every change in the entry text immediately, but only after a short
delay. To support this, <GtkSearchEntry>
emits the search-entry:search-changed signal which can be used
instead of the editable:changed
signal.
The search-entry:previous-match, search-entry:next-match and search-entry:stop-search signals can be used to
implement moving between search results and ending the search.
Often, <GtkSearchEntry> will be fed events by
means of being placed inside a <GtkSearchBar>.
If that is not the case, you can use search-entry:set-key-capture-widget to let it
capture key input from another widget.
<GtkSearchEntry> provides only minimal API and
should be used with the <GtkEditable> API.
The following signals have default keybindings:
entry.search ╰── text
<GtkSearchEntry> has a single CSS node with
name entry that carries a .search style class, and the text node
is a child of that.
<GtkSearchEntry> uses the
Gtk.AccessibleRole.search_box role.
Whether to activate the default widget when Enter is pressed.
Its value is a boolean.
Set it with (set! (search-entry:activates-default self) value).
The hints about input for the <GtkSearchEntry>
used to alter the behaviour of input methods.
Its value is a <GtkInputHints> (or, to set it,
a list of its symbols, or one of them).
Set it with (set! (search-entry:input-hints self) value).
The purpose for the <GtkSearchEntry> input
used to alter the behaviour of input methods.
Its value is a <GtkInputPurpose> (or, to set
it, one of its symbols).
Set it with (set! (search-entry:input-purpose self) value).
The widget that the entry will use to capture key events.
Key events are consumed by the search entry to start or continue a search.
Its value is a <GtkWidget>, or #f.
Set it with (set! (search-entry:key-capture-widget self) value).
The text that will be displayed in the
<GtkSearchEntry> when it is empty and
unfocused.
Its value is a string, or #f.
Set it with (set! (search-entry:placeholder-text self) value).
The delay in milliseconds from last keypress to the search changed signal.
Its value is an unsigned 32-bit integer.
Set it with (set! (search-entry:search-delay self) value).
Gets the input purpose for self.
Passed: a <GtkSearchEntry>.
Returned: a <GtkInputHints>.
The input hints
Gets the input purpose of self.
Passed: a <GtkSearchEntry>.
Returned: a <GtkInputPurpose>.
The input hints
Gets the widget that self is capturing key events from.
Passed: a <GtkSearchEntry>.
Returned: a <GtkWidget>, or #f.
The key capture widget.
Gets the placeholder text associated with self.
Passed: a <GtkSearchEntry>.
Returned: a string, or #f.
The placeholder text.
Get the delay to be used between the last keypress and the
search-entry:search-changed signal being emitted.
Passed: a <GtkSearchEntry>.
Returned: an unsigned 32-bit integer.
a delay in milliseconds.
Creates a <GtkSearchEntry>.
Returned: a <GtkWidget>.
a new <GtkSearchEntry>
Sets the input hints for self.
Passed: a <GtkSearchEntry>.
Passed: a <GtkInputHints>, or a list of its
symbols, or one of them.
the new input hints
Sets the input purpose of self.
Passed: a <GtkSearchEntry>.
Passed: a <GtkInputPurpose>, or one of its
symbols.
the new input purpose
Sets widget as the widget that self will capture key events from.
Key events are consumed by the search entry to start or continue a search.
If the entry is part of a <GtkSearchBar>, it is
preferable to call search-bar:set-key-capture-widget instead,
which will reveal the entry in addition to triggering the search entry.
Note that despite the name of this function, the events are only
’captured’ in the bubble phase, which means that editable child widgets
of widget will receive text input before it gets captured. If
that is not desired, you can capture and forward the events yourself
with event-controller-key:forward?.
Passed: a <GtkSearchEntry>.
Passed, or left out: a <GtkWidget>, or #f.
Sets the placeholder text associated with self.
Passed: a <GtkSearchEntry>.
Passed, or left out: a string, or #f.
the text to set as a placeholder
Set the delay to be used between the last keypress and the
search-entry:search-changed signal being emitted.
Passed: a <GtkSearchEntry>.
Passed: an unsigned 32-bit integer.
a delay in milliseconds
Connect a handler with (connect object search-entry:activate
handler). It is called as (handler self).
Emitted when the entry is activated.
The keybindings for this signal are all forms of the Enter key.
Passed: a <GtkSearchEntry>.
Connect a handler with (connect object search-entry:next-match
handler). It is called as (handler self).
Emitted when the user initiates a move to the next match for the current search string.
This is a keybinding signal.
Applications should connect to it, to implement moving between matches.
The default bindings for this signal is Ctrl+g.
Passed: a <GtkSearchEntry>.
Connect a handler with (connect object search-entry:previous-match
handler). It is called as (handler self).
Emitted when the user initiates a move to the previous match for the current search string.
This is a keybinding signal.
Applications should connect to it, to implement moving between matches.
The default bindings for this signal is Ctrl+Shift+g.
Passed: a <GtkSearchEntry>.
Connect a handler with (connect object search-entry:search-changed
handler). It is called as (handler self).
Emitted with a delay. The length of the delay can be changed with the
search-entry:search-delay property.
Passed: a <GtkSearchEntry>.
Connect a handler with (connect object search-entry:search-started
handler). It is called as (handler self).
Emitted when the user initiated a search on the entry.
Passed: a <GtkSearchEntry>.
Connect a handler with (connect object search-entry:stop-search
handler). It is called as (handler self).
Emitted when the user stops a search via keyboard input.
This is a keybinding signal.
Applications should connect to it, to implement hiding the search entry in this case.
The default bindings for this signal is Escape.
Passed: a <GtkSearchEntry>.