diff options
author | Tim Janik <timj@gtk.org> | 2003-11-27 15:51:32 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2003-11-27 15:51:32 +0000 |
commit | 448b576dc1c7e4c957614b821902e6c16c213934 (patch) | |
tree | cff96106bf060cd413c8fedb21bf97e972d330d7 /gtk/gtkaccelgroup.c | |
parent | 6e63e7f75a857b3d67c03505dd05771fda7c1d32 (diff) | |
download | gtk+-448b576dc1c7e4c957614b821902e6c16c213934.tar.gz |
allow accel activation depending on sensitivity and the attach widget.
Thu Nov 27 16:19:03 2003 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c: allow accel activation depending on sensitivity
and the attach widget.
* gtk/gtkmenuitem.c: allow accel activation depending on visibility,
sensitivity and the parent menu.
* gtk/gtkwidget.[hc]: introduced ::can-activate-accel signal which
checks whether accelerators may activate a widget. the default handler
demands the widget be sensitive and visible+viewable.
* gtk/gtkaccelgroup.[hc]: export gtk_accel_group_activate().
Diffstat (limited to 'gtk/gtkaccelgroup.c')
-rw-r--r-- | gtk/gtkaccelgroup.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c index 3a6020c857..a327fd2604 100644 --- a/gtk/gtkaccelgroup.c +++ b/gtk/gtkaccelgroup.c @@ -718,16 +718,17 @@ gtk_accel_group_from_accel_closure (GClosure *closure) } gboolean -_gtk_accel_group_activate (GtkAccelGroup *accel_group, - GQuark accel_quark, - GObject *acceleratable, - guint accel_key, - GdkModifierType accel_mods) +gtk_accel_group_activate (GtkAccelGroup *accel_group, + GQuark accel_quark, + GObject *acceleratable, + guint accel_key, + GdkModifierType accel_mods) { gboolean was_handled; g_return_val_if_fail (GTK_IS_ACCEL_GROUP (accel_group), FALSE); - + g_return_val_if_fail (G_IS_OBJECT (acceleratable), FALSE); + was_handled = FALSE; g_signal_emit (accel_group, signal_accel_activate, accel_quark, acceleratable, accel_key, accel_mods, &was_handled); @@ -767,7 +768,7 @@ gtk_accel_groups_activate (GObject *object, g_free (accel_name); for (slist = gtk_accel_groups_from_object (object); slist; slist = slist->next) - if (_gtk_accel_group_activate (slist->data, accel_quark, object, accel_key, accel_mods)) + if (gtk_accel_group_activate (slist->data, accel_quark, object, accel_key, accel_mods)) return TRUE; } |