Trait gtk::prelude::AccelGroupExt
source · [−]pub trait AccelGroupExt: 'static {
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
Required Methods
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
fn disconnect(&self, closure: Option<&Closure>) -> bool
fn disconnect(&self, closure: Option<&Closure>) -> bool
fn disconnect_key(&self, accel_key: u32, accel_mods: ModifierType) -> bool
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
fn modifier_mask(&self) -> ModifierType
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.
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.
fn connect_accel_activate<F: Fn(&Self, &Object, u32, ModifierType) -> bool + 'static>(
&self,
detail: Option<&str>,
f: F
) -> SignalHandlerId
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
fn connect_accel_changed<F: Fn(&Self, u32, ModifierType, &Closure) + '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
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