SearchEntry


Object Hierarchy:

Gtk.SearchEntry Gtk.SearchEntry Gtk.SearchEntry Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.SearchEntry GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Gtk.SearchEntry Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.SearchEntry Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Gtk.SearchEntry Gtk.ConstraintTarget->Gtk.Widget Gtk.Editable Gtk.Editable Gtk.Editable->Gtk.SearchEntry

Description:

[ CCode ( type_id = "gtk_search_entry_get_type ()" ) ]
public class SearchEntry : Widget, Accessible, Buildable, ConstraintTarget, Editable

`GtkSearchEntry` is an entry widget that has been tailored for use as a search entry.

The main API for interacting with a `GtkSearchEntry` as entry is the `GtkEditable` interface.

![An example GtkSearchEntry](search-entry.png)

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 [[email protected]:GtkSearchEntry:search-changed] signal which can be used instead of the [[email protected]:GtkSearchEntry:changed] signal.

The [[email protected]:GtkSearchEntry:previous-match], [[email protected]:GtkSearchEntry:next-match] and [[email protected]:GtkSearchEntry: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 [[email protected]]. If that is not the case, you can use [[email protected]_key_capture_widget] to let it capture key input from another widget.

`GtkSearchEntry` provides only minimal API and should be used with the [[email protected]] API.

CSS Nodes

``` 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.

Accessibility

`GtkSearchEntry` uses the gtk_accessible_role_search_box role.


Namespace: Gtk
Package: gtk4

Content:

Properties:

Creation methods:

Methods:

Signals:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object



2022 vala-language.org