Skip to main content

ResponseExt

Trait ResponseExt 

Source
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§

Source

fn on_click(&self, action: impl FnOnce()) -> &Self

Handle single-click events (convenience method)

Source

fn on_double_click(&self, action: impl FnOnce()) -> &Self

Handle double-click events

Source

fn on_triple_click(&self, action: impl FnOnce()) -> &Self

Handle triple-click events

Source

fn on_secondary_click(&self, action: impl FnOnce()) -> &Self

Handle secondary click (right-click) events

Source

fn on_middle_click(&self, action: impl FnOnce()) -> &Self

Handle middle click events

Source

fn on_hover(&self, action: impl FnOnce()) -> &Self

Handle hover events

Source

fn on_hover_start(&self, action: impl FnOnce()) -> &Self

Handle hover start (entering hover state)

Source

fn is_double_clicked(&self) -> bool

Check if the response was double-clicked (alias for double_clicked)

Source

fn is_middle_clicked(&self) -> bool

Check if the response was middle-clicked (alias for middle_clicked)

Source

fn is_secondary_clicked(&self) -> bool

Check if the response was secondary-clicked (alias for secondary_clicked)

Source

fn drag_started(&self) -> bool

Check if drag started this frame

Source

fn drag_stopped(&self) -> bool

Check if drag ended this frame

Source

fn highlight(&self, ui: &mut Ui) -> &Self

Highlight the response rect (for debugging or emphasis)

Source

fn show_tooltip_on_hover(&self, text: impl Into<String>) -> &Self

Show a tooltip on hover with the given text

Source

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".

Implementations on Foreign Types§

Source§

impl ResponseExt for Response

Source§

fn on_click(&self, action: impl FnOnce()) -> &Self

Source§

fn on_double_click(&self, action: impl FnOnce()) -> &Self

Source§

fn on_triple_click(&self, action: impl FnOnce()) -> &Self

Source§

fn on_secondary_click(&self, action: impl FnOnce()) -> &Self

Source§

fn on_middle_click(&self, action: impl FnOnce()) -> &Self

Source§

fn on_hover(&self, action: impl FnOnce()) -> &Self

Source§

fn on_hover_start(&self, action: impl FnOnce()) -> &Self

Source§

fn is_double_clicked(&self) -> bool

Source§

fn is_middle_clicked(&self) -> bool

Source§

fn is_secondary_clicked(&self) -> bool

Source§

fn drag_started(&self) -> bool

Source§

fn drag_stopped(&self) -> bool

Source§

fn highlight(&self, ui: &mut Ui) -> &Self

Source§

fn show_tooltip_on_hover(&self, text: impl Into<String>) -> &Self

Source§

fn set_cursor_icon(&self, icon: CursorIcon) -> &Self

Implementors§