Trait gtk::prelude::AccelGroupExtManual
source · [−]pub trait AccelGroupExtManual: 'static {
fn connect_accel_group<F>(
&self,
accel_key: u32,
accel_mods: ModifierType,
accel_flags: AccelFlags,
func: F
) -> Closure
where
F: Fn(&Self, &Object, u32, ModifierType) -> bool + 'static;
fn connect_accel_group_by_path<F>(
&self,
accel_path: &str,
func: F
) -> Closure
where
F: Fn(&Self, &Object, u32, ModifierType) -> bool + 'static;
}
Required Methods
fn connect_accel_group<F>(
&self,
accel_key: u32,
accel_mods: ModifierType,
accel_flags: AccelFlags,
func: F
) -> Closure where
F: Fn(&Self, &Object, u32, ModifierType) -> bool + 'static,
fn connect_accel_group<F>(
&self,
accel_key: u32,
accel_mods: ModifierType,
accel_flags: AccelFlags,
func: F
) -> Closure where
F: Fn(&Self, &Object, u32, ModifierType) -> bool + 'static,
Installs an accelerator in this group. When self
is being
activated in response to a call to accel_groups_activate()
,
closure
will be invoked if the accel_key
and accel_mods
from
accel_groups_activate()
match those of this connection.
The signature used for the closure
is that of GtkAccelGroupActivate
.
Note that, due to implementation details, a single closure can only be connected to one accelerator group.
accel_key
key value of the accelerator
accel_mods
modifier combination of the accelerator
accel_flags
a flag mask to configure this accelerator
closure
closure to be executed upon accelerator activation
fn connect_accel_group_by_path<F>(&self, accel_path: &str, func: F) -> Closure where
F: Fn(&Self, &Object, u32, ModifierType) -> bool + 'static,
fn connect_accel_group_by_path<F>(&self, accel_path: &str, func: F) -> Closure where
F: Fn(&Self, &Object, u32, ModifierType) -> bool + 'static,
Installs an accelerator in this group, using an accelerator path
to look up the appropriate key and modifiers (see
gtk_accel_map_add_entry()
). When self
is being activated
in response to a call to accel_groups_activate()
, closure
will
be invoked if the accel_key
and accel_mods
from
accel_groups_activate()
match the key and modifiers for the path.
The signature used for the closure
is that of GtkAccelGroupActivate
.
Note that accel_path
string will be stored in a GQuark
. Therefore,
if you pass a static string, you can save some memory by interning it
first with g_intern_static_string()
.
accel_path
path used for determining key and modifiers
closure
closure to be executed upon accelerator activation