gi-gtk-3.0.11: Gtk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.SearchEntry

Contents

Description

SearchEntry is a subclass of Entry that has been tailored for use as a search entry.

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

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

Often, GtkSearchEntry will be fed events by means of being placed inside a SearchBar. If that is not the case, you can use searchEntryHandleEvent to pass events.

Synopsis

Exported types

Methods

handleEvent

searchEntryHandleEvent Source #

Arguments

:: (HasCallStack, MonadIO m, IsSearchEntry a) 
=> a

entry: a SearchEntry

-> Event

event: a key event

-> m Bool

Returns: EVENT_STOP if the key press event resulted in a search beginning or continuing, EVENT_PROPAGATE otherwise.

This function should be called when the top-level window which contains the search entry received a key event. If the entry is part of a SearchBar, it is preferable to call searchBarHandleEvent instead, which will reveal the entry in addition to passing the event to this function.

If the key event is handled by the search entry and starts or continues a search, EVENT_STOP will be returned. The caller should ensure that the entry is shown in this case, and not propagate the event further.

Since: 3.16

new

searchEntryNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m SearchEntry

Returns: a new SearchEntry

Creates a SearchEntry, with a find icon when the search field is empty, and a clear icon when it isn't.

Since: 3.6

Signals

nextMatch

previousMatch

searchChanged

stopSearch