pub trait ResponseExt {
Show 15 methods
// Required methods
fn on_click(&self, action: impl FnOnce()) -> &Self;
fn on_double_click(&self, action: impl FnOnce()) -> &Self;
fn on_triple_click(&self, action: impl FnOnce()) -> &Self;
fn on_secondary_click(&self, action: impl FnOnce()) -> &Self;
fn on_middle_click(&self, action: impl FnOnce()) -> &Self;
fn on_hover(&self, action: impl FnOnce()) -> &Self;
fn on_hover_start(&self, action: impl FnOnce()) -> &Self;
fn is_double_clicked(&self) -> bool;
fn is_middle_clicked(&self) -> bool;
fn is_secondary_clicked(&self) -> bool;
fn drag_started(&self) -> bool;
fn drag_stopped(&self) -> bool;
fn highlight(&self, ui: &mut Ui) -> &Self;
fn show_tooltip_on_hover(&self, text: impl Into<String>) -> &Self;
fn set_cursor_icon(&self, icon: CursorIcon) -> &Self;
}Expand description
Extension trait for egui::Response providing convenience methods
Note: Some egui Response methods consume self. For those methods, use the egui Response methods directly rather than these extensions.
Required Methods§
Sourcefn on_click(&self, action: impl FnOnce()) -> &Self
fn on_click(&self, action: impl FnOnce()) -> &Self
Handle single-click events (convenience method)
Sourcefn on_double_click(&self, action: impl FnOnce()) -> &Self
fn on_double_click(&self, action: impl FnOnce()) -> &Self
Handle double-click events
Sourcefn on_triple_click(&self, action: impl FnOnce()) -> &Self
fn on_triple_click(&self, action: impl FnOnce()) -> &Self
Handle triple-click events
Sourcefn on_secondary_click(&self, action: impl FnOnce()) -> &Self
fn on_secondary_click(&self, action: impl FnOnce()) -> &Self
Handle secondary click (right-click) events
Sourcefn on_middle_click(&self, action: impl FnOnce()) -> &Self
fn on_middle_click(&self, action: impl FnOnce()) -> &Self
Handle middle click events
Sourcefn on_hover_start(&self, action: impl FnOnce()) -> &Self
fn on_hover_start(&self, action: impl FnOnce()) -> &Self
Handle hover start (entering hover state)
Sourcefn is_double_clicked(&self) -> bool
fn is_double_clicked(&self) -> bool
Check if the response was double-clicked (alias for double_clicked)
Sourcefn is_middle_clicked(&self) -> bool
fn is_middle_clicked(&self) -> bool
Check if the response was middle-clicked (alias for middle_clicked)
Sourcefn is_secondary_clicked(&self) -> bool
fn is_secondary_clicked(&self) -> bool
Check if the response was secondary-clicked (alias for secondary_clicked)
Sourcefn drag_started(&self) -> bool
fn drag_started(&self) -> bool
Check if drag started this frame
Sourcefn drag_stopped(&self) -> bool
fn drag_stopped(&self) -> bool
Check if drag ended this frame
Sourcefn highlight(&self, ui: &mut Ui) -> &Self
fn highlight(&self, ui: &mut Ui) -> &Self
Highlight the response rect (for debugging or emphasis)
Sourcefn show_tooltip_on_hover(&self, text: impl Into<String>) -> &Self
fn show_tooltip_on_hover(&self, text: impl Into<String>) -> &Self
Show a tooltip on hover with the given text
Sourcefn set_cursor_icon(&self, icon: CursorIcon) -> &Self
fn set_cursor_icon(&self, icon: CursorIcon) -> &Self
Set cursor icon when hovering over this response
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".