package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Search_bar

type t = [ `search_bar | `widget | `initially_unowned | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new SearchBar

val set_show_close_button : t -> bool -> unit

Shows or hides the close button.

Applications that already have a “search” toggle button should not show a close button in their search bar, as it duplicates the role of the toggle button.

val set_search_mode : t -> bool -> unit

Switches the search mode on or off.

val set_key_capture_widget : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj option -> unit

Sets @widget as the widget that @bar will capture key events from.

If key events are handled by the search bar, the bar will be shown, and the entry populated with the entered text.

Note that despite the name of this function, the events are only 'captured' in the bubble phase, which means that editable child widgets of @widget will receive text input before it gets captured. If that is not desired, you can capture and forward the events yourself with method@Gtk.EventControllerKey.forward.

val set_child : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj option -> unit

Sets the child widget of @bar.

val get_show_close_button : t -> bool

Returns whether the close button is shown.

val get_search_mode : t -> bool

Returns whether the search mode is on or off.

val get_key_capture_widget : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj option

Gets the widget that @bar is capturing key events from.

val get_child : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj option

Gets the child widget of @bar.

val connect_entry : t -> [ `editable ] Gobject.obj -> unit

Connects the `GtkEditable` widget passed as the one to be used in this search bar.

The entry should be a descendant of the search bar. Calling this function manually is only required if the entry isn’t the direct child of the search bar (as in our main example).

val get_search_mode_enabled : t -> bool

Get property: search-mode-enabled

val set_search_mode_enabled : t -> bool -> unit

Set property: search-mode-enabled