gtk4::prelude

Trait EventControllerExt

Source
pub trait EventControllerExt:
    IsA<EventController>
    + Sealed
    + 'static {
Show 17 methods // Provided methods fn current_event(&self) -> Option<Event> { ... } fn current_event_device(&self) -> Option<Device> { ... } fn current_event_state(&self) -> ModifierType { ... } fn current_event_time(&self) -> u32 { ... } fn name(&self) -> Option<GString> { ... } fn propagation_limit(&self) -> PropagationLimit { ... } fn propagation_phase(&self) -> PropagationPhase { ... } fn widget(&self) -> Option<Widget> { ... } fn reset(&self) { ... } fn set_name(&self, name: Option<&str>) { ... } fn set_propagation_limit(&self, limit: PropagationLimit) { ... } fn set_propagation_phase(&self, phase: PropagationPhase) { ... } fn set_static_name(&self, name: Option<&str>) { ... } fn connect_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_propagation_limit_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_propagation_phase_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Provided Methods§

Source

fn current_event(&self) -> Option<Event>

Returns the event that is currently being handled by the controller.

At other times, None is returned.

§Returns

the event that is currently handled by @self

Source

fn current_event_device(&self) -> Option<Device>

Returns the device of the event that is currently being handled by the controller.

At other times, None is returned.

§Returns

device of the event is currently handled by @self

Source

fn current_event_state(&self) -> ModifierType

Returns the modifier state of the event that is currently being handled by the controller.

At other times, 0 is returned.

§Returns

modifier state of the event is currently handled by @self

Source

fn current_event_time(&self) -> u32

Returns the timestamp of the event that is currently being handled by the controller.

At other times, 0 is returned.

§Returns

timestamp of the event is currently handled by @self

Source

fn name(&self) -> Option<GString>

Gets the name of @self.

§Returns

The controller name

Source

fn propagation_limit(&self) -> PropagationLimit

Gets the propagation limit of the event controller.

§Returns

the propagation limit

Source

fn propagation_phase(&self) -> PropagationPhase

Gets the propagation phase at which @self handles events.

§Returns

the propagation phase

Source

fn widget(&self) -> Option<Widget>

Returns the Widget this controller relates to.

§Returns

a Widget

Source

fn reset(&self)

Resets the @self to a clean state.

Source

fn set_name(&self, name: Option<&str>)

Sets a name on the controller that can be used for debugging.

§name

a name for @self

Source

fn set_propagation_limit(&self, limit: PropagationLimit)

Sets the event propagation limit on the event controller.

If the limit is set to PropagationLimit::SameNative, the controller won’t handle events that are targeted at widgets on a different surface, such as popovers.

§limit

the propagation limit

Source

fn set_propagation_phase(&self, phase: PropagationPhase)

Sets the propagation phase at which a controller handles events.

If @phase is PropagationPhase::None, no automatic event handling will be performed, but other additional gesture maintenance will.

§phase

a propagation phase

Source

fn set_static_name(&self, name: Option<&str>)

Available on crate feature v4_8 only.

Sets a name on the controller that can be used for debugging.

§name

a name for @self, must be a static string

Source

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

Source

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

Source

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

Source

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

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§