gtk.search_entry
Module for [SearchEntry] class
Types 3
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.
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 gtk.search_entry.SearchEntry.searchChanged signal which can be used instead of the gtk.editable.Editable.changed signal.
The gtk.search_entry.SearchEntry.previousMatch, gtk.search_entry.SearchEntry.nextMatch and gtk.search_entry.SearchEntry.stopSearch 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
╰── textgtk.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.
SearchEntryGidBuilder builder() static nothrowGet builder for [gtk.search_entry.SearchEntry] Returns: New builder objectbool activatesDefault() @property nothrowGet `activatesDefault` property. Returns: Whether to activate the default widget when Enter is pressed.void activatesDefault(bool propval) @property nothrowSet `activatesDefault` property. Params: propval = Whether to activate the default widget when Enter is pressed.gtk.types.InputHints inputHints() @property nothrowGet `inputHints` property. Returns: The hints about input for the [gtk.search_entry.SearchEntry] used to alter the behaviour of input methods.void inputHints(gtk.types.InputHints propval) @property nothrowSet `inputHints` property. Params: propval = The hints about input for the [gtk.search_entry.SearchEntry] used to alter the behaviour of input methods.gtk.types.InputPurpose inputPurpose() @property nothrowGet `inputPurpose` property. Returns: The purpose for the [gtk.search_entry.SearchEntry] input used to alter the behaviour of input methods.void inputPurpose(gtk.types.InputPurpose propval) @property nothrowSet `inputPurpose` property. Params: propval = The purpose for the [gtk.search_entry.SearchEntry] input used to alter the behaviour of input methods.string placeholderText() @property nothrowGet `placeholderText` property. Returns: The text that will be displayed in the [gtk.search_entry.SearchEntry] when it is empty and unfocused.void placeholderText(string propval) @property nothrowSet `placeholderText` property. Params: propval = The text that will be displayed in the [gtk.search_entry.SearchEntry] when it is empty and unfocused.uint searchDelay() @property nothrowGet `searchDelay` property. Returns: The delay in milliseconds from last keypress to the search changed signal.void searchDelay(uint propval) @property nothrowSet `searchDelay` property. Params: propval = The delay in milliseconds from last keypress to the search changed signal.gtk.types.InputHints getInputHints() nothrowGets the input purpose for entry. Returns: The input hintsgtk.types.InputPurpose getInputPurpose() nothrowGets the input purpose of entry. Returns: The input hintsgtk.widget.Widget getKeyCaptureWidget() nothrowGets the widget that entry is capturing key events from. Returns: The key capture widget.string getPlaceholderText() nothrowGets the placeholder text associated with entry. Returns: The placeholder text.uint getSearchDelay() nothrowGet the delay to be used between the last keypress and the [gtk.search_entry.SearchEntry.searchChanged] signal being emitted. Returns: a delay in milliseconds.void setKeyCaptureWidget(gtk.widget.Widget widget = null) nothrowSets widget as the widget that entry will capture key events from.void setSearchDelay(uint delay) nothrowSet the delay to be used between the last keypress and the [gtk.search_entry.SearchEntry.searchChanged] signal being emitted.gulong connectActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.search_entry.SearchEntry)))
&& Parameters!T.length < 2) nothrowConnect to `Activate` signal.gulong connectNextMatch(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.search_entry.SearchEntry)))
&& Parameters!T.length < 2) nothrowConnect to `NextMatch` signal.gulong connectPreviousMatch(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.search_entry.SearchEntry)))
&& Parameters!T.length < 2) nothrowConnect to `PreviousMatch` signal.gulong connectSearchChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.search_entry.SearchEntry)))
&& Parameters!T.length < 2) nothrowConnect to `SearchChanged` signal.gulong connectSearchStarted(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.search_entry.SearchEntry)))
&& Parameters!T.length < 2) nothrowConnect to `SearchStarted` signal.gulong connectStopSearch(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.search_entry.SearchEntry)))
&& Parameters!T.length < 2) nothrowConnect to `StopSearch` signal.Fluent builder implementation template for gtk.search_entry.SearchEntry
T activatesDefault(bool propval) nothrowSet `activatesDefault` property. Params: propval = Whether to activate the default widget when Enter is pressed. Returns: Builder instance for fluent chainingT inputHints(gtk.types.InputHints propval) nothrowSet `inputHints` property. Params: propval = The hints about input for the [gtk.search_entry.SearchEntry] used to alter the behaviour of input methods. Returns: Builder instance for fluent chainingT inputPurpose(gtk.types.InputPurpose propval) nothrowSet `inputPurpose` property. Params: propval = The purpose for the [gtk.search_entry.SearchEntry] input used to alter the behaviour of input methods. Returns: Builder instance for fluent chainingT placeholderText(string propval) nothrowSet `placeholderText` property. Params: propval = The text that will be displayed in the [gtk.search_entry.SearchEntry] when it is empty and unfocused. Returns: Builder instance for fluent chainingT searchDelay(uint propval) nothrowSet `searchDelay` property. Params: propval = The delay in milliseconds from last keypress to the search changed signal. Returns: Builder instance for fluent chainingFluent builder for gtk.search_entry.SearchEntry