pub trait SearchBarExt: IsA<SearchBar> + 'static {
// Provided methods
fn connect_entry(&self, entry: &impl IsA<Entry>) { ... }
fn is_search_mode(&self) -> bool { ... }
fn shows_close_button(&self) -> bool { ... }
fn handle_event(&self, event: &Event) -> bool { ... }
fn set_search_mode(&self, search_mode: bool) { ... }
fn set_show_close_button(&self, visible: bool) { ... }
fn is_search_mode_enabled(&self) -> bool { ... }
fn set_search_mode_enabled(&self, search_mode_enabled: bool) { ... }
fn connect_search_mode_enabled_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_show_close_button_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Provided Methods§
Sourcefn connect_entry(&self, entry: &impl IsA<Entry>)
fn connect_entry(&self, entry: &impl IsA<Entry>)
Sourcefn is_search_mode(&self) -> bool
fn is_search_mode(&self) -> bool
Sourcefn handle_event(&self, event: &Event) -> bool
fn handle_event(&self, event: &Event) -> bool
static gboolean on_key_press_event (GtkWidget *widget, GdkEvent *event, gpointer user_data) { GtkSearchBar *bar = GTK_SEARCH_BAR (user_data); return gtk_search_bar_handle_event (bar, event); }
static void create_toplevel (void) { GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); GtkWindow *search_bar = gtk_search_bar_new ();
// Add more widgets to the window…
g_signal_connect (window, “key-press-event”, G_CALLBACK (on_key_press_event), search_bar); } ]|
§event
a GdkEvent containing key press events
§Returns
GDK_EVENT_STOP if the key press event resulted
in text being entered in the search entry (and revealing
the search bar if necessary), GDK_EVENT_PROPAGATE otherwise.
Sourcefn set_search_mode(&self, search_mode: bool)
fn set_search_mode(&self, search_mode: bool)
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.
§visible
whether the close button will be shown or not
fn is_search_mode_enabled(&self) -> bool
fn set_search_mode_enabled(&self, search_mode_enabled: bool)
fn connect_search_mode_enabled_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".