[]Struct gtk::GestureMultiPress

pub struct GestureMultiPress(_, _);

GestureMultiPress is a Gesture implementation able to recognize multiple clicks on a nearby zone, which can be listened for through the GestureMultiPress::pressed signal. Whenever time or distance between clicks exceed the GTK+ defaults, GestureMultiPress::stopped is emitted, and the click counter is reset.

Callers may also restrict the area that is considered valid for a >1 touch/button press through GestureMultiPress::set_area, so any click happening outside that area is considered to be a first click of its own.

Implements

GestureSingleExt, GestureExt, EventControllerExt, glib::object::ObjectExt

Implementations

impl GestureMultiPress[src]

pub fn new<P: IsA<Widget>>(widget: &P) -> GestureMultiPress[src]

Returns a newly created Gesture that recognizes single and multiple presses.

widget

a Widget

Returns

a newly created GestureMultiPress

pub fn get_area(&self) -> Option<Rectangle>[src]

If an area was set through GestureMultiPress::set_area, this function will return true and fill in rect with the press area. See GestureMultiPress::set_area for more details on what the press area represents.

rect

return location for the press area

Returns

true if rect was filled with the press area

pub fn set_area(&self, rect: Option<&Rectangle>)[src]

If rect is non-None, the press area will be checked to be confined within the rectangle, otherwise the button count will be reset so the press is seen as being the first one. If rect is None, the area will be reset to an unrestricted state.

Note: The rectangle is only used to determine whether any non-first click falls within the expected area. This is not akin to an input shape.

rect

rectangle to receive coordinates on

pub fn connect_pressed<F: Fn(&GestureMultiPress, i32, f64, f64) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

This signal is emitted whenever a button or touch press happens.

n_press

how many touch/button presses happened with this one

x

The X coordinate, in widget allocation coordinates

y

The Y coordinate, in widget allocation coordinates

pub fn connect_released<F: Fn(&GestureMultiPress, i32, f64, f64) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

This signal is emitted when a button or touch is released. n_press will report the number of press that is paired to this event, note that GestureMultiPress::stopped may have been emitted between the press and its release, n_press will only start over at the next press.

n_press

number of press that is paired with this release

x

The X coordinate, in widget allocation coordinates

y

The Y coordinate, in widget allocation coordinates

pub fn connect_stopped<F: Fn(&GestureMultiPress) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

This signal is emitted whenever any time/distance threshold has been exceeded.

Trait Implementations

impl Clone for GestureMultiPress

impl Debug for GestureMultiPress

impl Display for GestureMultiPress[src]

impl Eq for GestureMultiPress

impl Hash for GestureMultiPress

impl IsA<EventController> for GestureMultiPress

impl IsA<Gesture> for GestureMultiPress

impl IsA<GestureSingle> for GestureMultiPress

impl Ord for GestureMultiPress

impl<T: ObjectType> PartialEq<T> for GestureMultiPress

impl<T: ObjectType> PartialOrd<T> for GestureMultiPress

impl StaticType for GestureMultiPress

Auto Trait Implementations

impl RefUnwindSafe for GestureMultiPress

impl !Send for GestureMultiPress

impl !Sync for GestureMultiPress

impl Unpin for GestureMultiPress

impl UnwindSafe for GestureMultiPress

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.