GtkSearchEntry

gtk.search_entry.SearchEntry is an entry widget that has been tailored for use as a search entry.

The main API for interacting with a gtk.search_entry.SearchEntry as entry is the gtk.editable.Editable interface.

An example 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.

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, gtk.search_entry.SearchEntry emits the signal@Gtk.SearchEntry::search-changed signal which can be used instead of the gtk.editable.Editable.changed signal.

The signal@Gtk.SearchEntry::previous-match, signal@Gtk.SearchEntry::next-match and signal@Gtk.SearchEntry::stop-search signals can be used to implement moving between search results and ending the search.

Often, gtk.search_entry.SearchEntry will be fed events by means of being placed inside a gtk.search_bar.SearchBar. If that is not the case, you can use gtk.search_entry.SearchEntry.setKeyCaptureWidget to let it capture key input from another widget.

gtk.search_entry.SearchEntry provides only minimal API and should be used with the gtk.editable.Editable API.

CSS Nodes

entry.search
╰── text

gtk.search_entry.SearchEntry has a single CSS node with name entry that carries a .search style class, and the text node is a child of that.

Accessibility

gtk.search_entry.SearchEntry uses the gtk.types.AccessibleRole.SearchBox role.

struct GtkSearchEntry