The
gtk:search-entry class is a subclass of the
gtk:entry
class that has been tailored for use as a search entry.
Figure: GtkSearchEntry
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.
Note that the search/clear icon is shown using a secondary icon, and thus
does not work if you are using the secondary icon position for some other
purpose.
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, the
gtk:search-entry widget emits the
"search-changed" signal which can be used instead of the
"changed" signal.
Signal Details
The "next-match" signal
lambda (entry) :action
The signal is a keybinding signal which gets emitted when the user
initiates a move to the next match for the current search string.
Applications should connect to it, to implement moving between matches. The default bindings for this signal is the
Ctrl-g key.
- entry
- The gtk:search-entry widget on which the signal was emitted.
The "previous-match" signal
lambda (entry) :action
The signal is a keybinding signal which gets emitted when the user
initiates a move to the previous match for the current search string.
Applications should connect to it, to implement moving between matches. The default bindings for this signal is the
Ctrl-Shift-g key.
- entry
- The gtk:search-entry widget on which the signal was emitted.
The "search-changed" signal
lambda (entry) :run-last
The signal is emitted with a short delay of 150 milliseconds after the
last change to the entry text.
- entry
- The gtk:search-entry widget on which the signal was emitted.
The "stop-search" signal
lambda (entry) :action
The signal is a keybinding signal which gets emitted when the user stops
a search via keyboard input. Applications should connect to it, to
implement hiding the search entry in this case. The default bindings for this signal is the
Escape key.
- entry
- The gtk:search-entry widget on which the signal was emitted.