gtk4::prelude

Trait ShortcutActionExt

Source
pub trait ShortcutActionExt:
    IsA<ShortcutAction>
    + Sealed
    + 'static {
    // Provided methods
    fn activate(
        &self,
        flags: ShortcutActionFlags,
        widget: &impl IsA<Widget>,
        args: Option<&Variant>,
    ) -> bool { ... }
    fn to_str(&self) -> GString { ... }
}
Expand description

Provided Methods§

Source

fn activate( &self, flags: ShortcutActionFlags, widget: &impl IsA<Widget>, args: Option<&Variant>, ) -> bool

Activates the action on the @widget with the given @args.

Note that some actions ignore the passed in @flags, @widget or @args.

Activation of an action can fail for various reasons. If the action is not supported by the @widget, if the @args don’t match the action or if the activation otherwise had no effect, false will be returned.

§flags

flags to activate with

§widget

Target of the activation

§args

arguments to pass

§Returns

true if this action was activated successfully

Source

fn to_str(&self) -> GString

Prints the given action into a human-readable string.

This is a small wrapper around Gtk::ShortcutAction::print() to help when debugging.

§Returns

a new string

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§