Skip to main content

AccelGroupExt

Trait AccelGroupExt 

Source
pub trait AccelGroupExt: IsA<AccelGroup> + 'static {
    // Provided methods
    fn activate(
        &self,
        accel_quark: Quark,
        acceleratable: &impl IsA<Object>,
        accel_key: u32,
        accel_mods: ModifierType,
    ) -> bool { ... }
    fn disconnect(&self, closure: Option<&Closure>) -> bool { ... }
    fn disconnect_key(&self, accel_key: u32, accel_mods: ModifierType) -> bool { ... }
    fn is_locked(&self) -> bool { ... }
    fn modifier_mask(&self) -> ModifierType { ... }
    fn lock(&self) { ... }
    fn unlock(&self) { ... }
    fn connect_accel_activate<F: Fn(&Self, &Object, u32, ModifierType) -> bool + 'static>(
        &self,
        detail: Option<&str>,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_accel_changed<F: Fn(&Self, u32, ModifierType, &Closure) + 'static>(
        &self,
        detail: Option<&str>,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_is_locked_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_modifier_mask_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all AccelGroup methods.

§Implementors

AccelGroup

Provided Methods§

Source

fn activate( &self, accel_quark: Quark, acceleratable: &impl IsA<Object>, accel_key: u32, accel_mods: ModifierType, ) -> bool

Finds the first accelerator in self that matches accel_key and accel_mods, and activates it.

§accel_quark

the quark for the accelerator name

§acceleratable

the glib::Object, usually a Window, on which to activate the accelerator

§accel_key

accelerator keyval from a key event

§accel_mods

keyboard state mask from a key event

§Returns

true if an accelerator was activated and handled this keypress

Source

fn disconnect(&self, closure: Option<&Closure>) -> bool

Removes an accelerator previously installed through AccelGroupExtManual::connect_accel_group().

Since 2.20 closure can be None.

§closure

the closure to remove from this accelerator group, or None to remove all closures

§Returns

true if the closure was found and got disconnected

Source

fn disconnect_key(&self, accel_key: u32, accel_mods: ModifierType) -> bool

Removes an accelerator previously installed through AccelGroupExtManual::connect_accel_group().

§accel_key

key value of the accelerator

§accel_mods

modifier combination of the accelerator

§Returns

true if there was an accelerator which could be removed, false otherwise

Source

fn is_locked(&self) -> bool

Locks are added and removed using lock() and unlock().

§Returns

true if there are 1 or more locks on the self, false otherwise.

Source

fn modifier_mask(&self) -> ModifierType

Gets a gdk::ModifierType representing the mask for this self. For example, gdk::ModifierType::CONTROL_MASK, gdk::ModifierType::SHIFT_MASK, etc.

§Returns

the modifier mask for this accel group.

Source

fn lock(&self)

Locks the given accelerator group.

Locking an acelerator group prevents the accelerators contained within it to be changed during runtime. Refer to gtk_accel_map_change_entry() about runtime accelerator changes.

If called more than once, self remains locked until unlock() has been called an equivalent number of times.

Source

fn unlock(&self)

Undoes the last call to lock() on this self.

Source

fn connect_accel_activate<F: Fn(&Self, &Object, u32, ModifierType) -> bool + 'static>( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId

The accel-activate signal is an implementation detail of AccelGroup and not meant to be used by applications.

§acceleratable

the object on which the accelerator was activated

§keyval

the accelerator keyval

§modifier

the modifier combination of the accelerator

§Returns

true if the accelerator was activated

Source

fn connect_accel_changed<F: Fn(&Self, u32, ModifierType, &Closure) + 'static>( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId

The accel-changed signal is emitted when an entry is added to or removed from the accel group.

Widgets like AccelLabel which display an associated accelerator should connect to this signal, and rebuild their visual representation if the accel_closure is theirs.

§keyval

the accelerator keyval

§modifier

the modifier combination of the accelerator

§accel_closure

the glib::Closure of the accelerator

Source

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

Source

fn connect_modifier_mask_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".

Implementors§