Skip to main content

Clickable

Trait Clickable 

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

Source

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.

Source

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

Implementations on Foreign Types§

Source§

impl<T> Clickable for AnimationElement<T>
where T: Clickable + 'static,

Source§

fn on_click( self, handler: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, ) -> Self

Source§

fn cursor_style(self, cursor_style: CursorStyle) -> Self

Implementors§