Trait gtk4::prelude::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) -> 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
Trait containing all EventController
methods.
§Implementors
DropControllerMotion
, DropTargetAsync
, DropTarget
, EventControllerFocus
, EventControllerKey
, EventControllerLegacy
, EventControllerMotion
, EventControllerScroll
, EventController
, Gesture
, PadController
, ShortcutController
Provided Methods§
sourcefn current_event(&self) -> Option<Event>
fn current_event(&self) -> Option<Event>
sourcefn current_event_device(&self) -> Option<Device>
fn current_event_device(&self) -> Option<Device>
sourcefn current_event_state(&self) -> ModifierType
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
sourcefn current_event_time(&self) -> u32
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
sourcefn propagation_limit(&self) -> PropagationLimit
fn propagation_limit(&self) -> PropagationLimit
sourcefn propagation_phase(&self) -> PropagationPhase
fn propagation_phase(&self) -> PropagationPhase
sourcefn set_propagation_limit(&self, limit: PropagationLimit)
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
sourcefn set_propagation_phase(&self, phase: PropagationPhase)
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
sourcefn set_static_name(&self, name: Option<&str>)
Available on crate feature v4_8
only.
fn set_static_name(&self, name: Option<&str>)
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