gtk4::prelude

Trait GestureDragExt

Source
pub trait GestureDragExt: IsA<GestureDrag> + 'static {
    // Provided methods
    fn offset(&self) -> Option<(f64, f64)> { ... }
    fn start_point(&self) -> Option<(f64, f64)> { ... }
    fn connect_drag_begin<F: Fn(&Self, f64, f64) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_drag_end<F: Fn(&Self, f64, f64) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_drag_update<F: Fn(&Self, f64, f64) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all GestureDrag methods.

§Implementors

GestureDrag, GesturePan

Provided Methods§

Source

fn offset(&self) -> Option<(f64, f64)>

Gets the offset from the start point.

If the @self is active, this function returns true and fills in @x and @y with the coordinates of the current point, as an offset to the starting drag point.

§Returns

true if the gesture is active

§x

X offset for the current point

§y

Y offset for the current point

Source

fn start_point(&self) -> Option<(f64, f64)>

Gets the point where the drag started.

If the @self is active, this function returns true and fills in @x and @y with the drag start coordinates, in widget-relative coordinates.

§Returns

true if the gesture is active

§x

X coordinate for the drag start point

§y

Y coordinate for the drag start point

Source

fn connect_drag_begin<F: Fn(&Self, f64, f64) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted whenever dragging starts.

§start_x

X coordinate, relative to the widget allocation

§start_y

Y coordinate, relative to the widget allocation

Source

fn connect_drag_end<F: Fn(&Self, f64, f64) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted whenever the dragging is finished.

§offset_x

X offset, relative to the start point

§offset_y

Y offset, relative to the start point

Source

fn connect_drag_update<F: Fn(&Self, f64, f64) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted whenever the dragging point moves.

§offset_x

X offset, relative to the start point

§offset_y

Y offset, relative to the start point

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§