pub trait Clickable {
// Required methods
fn on_click(
self,
handler: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Self;
fn cursor_style(self, cursor_style: CursorStyle) -> Self;
}Expand description
A trait for elements that can be clicked. Enables the use of the on_click method.
Required Methods§
Sourcefn on_click(
self,
handler: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_click( self, handler: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, ) -> Self
Sets the click handler that will fire whenever the element is clicked.
Sourcefn cursor_style(self, cursor_style: CursorStyle) -> Self
fn cursor_style(self, cursor_style: CursorStyle) -> Self
Sets the cursor style when hovering over the element.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".