Package: gtk
Class gtk:search-bar
Superclassesgtk:widget, gobject:initially-unowned, gtk:accessible, gtk:buildable, gtk:constraint-target, gobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsDetails The gtk:search-bar widget is a container made to have a search
entry.
It can also contain additional widgets, such as drop-down menus, or buttons.
The search bar would appear when a search is started through typing on the
keyboard, or the search mode of the application is toggled on. ![]() For keyboard presses to start a search, the search bar must be told of a widget to capture key events from through the gtk:search-bar-key-capture-widget function. This widget will typically be the toplevel window, or a parent container of the search bar. 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 the gtk:search-bar-connect-entry function. Examples(defun do-search-bar (&optional application) (let* ((box (make-instance 'gtk:box :orientation :horizontal :spacing 6)) (searchbar (make-instance 'gtk:search-bar :child box :valign :start)) (window (make-instance 'gtk:window :title "Search Bar" :application application :child searchbar)) (entry (make-instance 'gtk:search-entry :hexpand t)) (button (make-instance 'gtk:menu-button))) (gtk:search-bar-connect-entry searchbar entry) (setf (gtk:search-bar-key-capture-widget searchbar) window) (gtk:box-append box entry) (gtk:box-append box button) (gtk:window-present window))) CSS nodessearchbar ╰── revealer ╰── box ├── [child] ╰── [button.close]The gtk:search-bar implementation has a single CSS node with name searchbar. It has a child node with name revealer that contains a node with name box. The box node contains both the CSS node of the child widget as well as an optional button node which gets the .close style class applied. Accessibility | Returned bySlot Access Functions
Inherited Slot Access FunctionsSee also |
2024-4-20