Function freya::elements::onwheel

source ·
pub fn onwheel<'a>(
    _cx: &'a ScopeState,
    _f: impl FnMut(Event<WheelData>) + 'a
) -> Attribute<'a>
Expand description

The wheel event will fire when the user scrolls the mouse wheel.

Event Data: TouchData

Example:

fn app(cx: Scope) -> Element {
    render!(
        rect {
            width: "100",
            height: "100",
            background: "red",
            onwheel: |_| println!("Scrolling with the wheel!")
        }
    )
}