SearchBarRef

public struct SearchBarRef : SearchBarProtocol, GWeakCapturing

GtkSearchBar is a container made to have a search entry (possibly with additional connex widgets, such as drop-down menus, or buttons) built-in. The search bar would appear when a search is started through typing on the keyboard, or the application’s search mode is toggled on.

For keyboard presses to start a search, events will need to be forwarded from the top-level window that contains the search bar. See gtk_search_bar_handle_event() for example code. Common shortcuts such as Ctrl+F should be handled as an application action, or through the menu items.

You will also need to tell the search bar about which entry you are using as your search entry using gtk_search_bar_connect_entry(). The following example shows you how to create a more complex search entry.

CSS nodes

GtkSearchBar has a single CSS node with name searchbar.

A simple example

The SearchBarRef type acts as a lightweight Swift reference to an underlying GtkSearchBar instance. It exposes methods that can operate on this data type through SearchBarProtocol conformance. Use SearchBarRef only as an unowned reference to an existing GtkSearchBar instance.

  • ptr
    Untyped pointer to the underlying `GtkSearchBar` instance.
    

    For type-safe access, use the generated, typed pointer search_bar_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

SearchBar Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkSearchBar>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkSearchBar>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkSearchBar>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkSearchBar>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements SearchBarProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : SearchBarProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> SearchBarRef where T : SearchBarProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to SearchBarProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to SearchBarProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to SearchBarProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to SearchBarProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to SearchBarProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a `GtkSearchBar`. You will need to tell it about
    

    which widget is going to be your text entry using gtk_search_bar_connect_entry().

    Declaration

    Swift

    @inlinable
    init()