summaryrefslogtreecommitdiff
path: root/gtk/gtkwidget.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-12-08 22:55:03 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-12-08 22:55:03 +0000
commit85c05a86c05e002c8160ecabe73a372b267b6931 (patch)
treed1bed6fe58a6aac22fa33e45e51a53c25edb17d7 /gtk/gtkwidget.c
parentdfddc2062865c901d7ab9de90214f3aed89bd4eb (diff)
downloadgtk+-85c05a86c05e002c8160ecabe73a372b267b6931.tar.gz
=== Released 2.3.1 ===
Mon Dec 8 10:54:44 2003 Owen Taylor <otaylor@redhat.com> * === Released 2.3.1 === * NEWS: Updates for 2.3.1 * configure.in: Version 2.3.1, interface age 0, binary age 301. * gtk/gtkmenuitem.c (gtk_menu_item_can_activate_accel): Rename from gtk_menu_item_real_can_activate_accel() to match GTK+ convention, improve comment. * gtk/gtkwidget.c: Document gtk_widget_can_activate_accel(), can ::can-activate-accel signal. * gtk/gtkwidget.c (closure_accel_activate): Fix spelling in comment. * gtk/gtkmenu.c (gtk_menu_real_can_activate_accel): Clean up comment. * gtk/gtkcellview{,menuitem}.[ch]: Move GET_PRIVATE() macros into the .c file. Mon Dec 8 12:09:21 2003 Owen Taylor <otaylor@redhat.com> * gtk/gtkicontheme.c (find_builtin_icon): Fix a missing 'else'. (#128816, Jorn Baayen)
Diffstat (limited to 'gtk/gtkwidget.c')
-rw-r--r--gtk/gtkwidget.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f7dc67ae80..9c66beccc5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -1313,6 +1313,18 @@ gtk_widget_class_init (GtkWidgetClass *klass)
_gtk_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GDK_TYPE_SCREEN);
+/**
+ * GtkWidget::can-activate-accel:
+ * @widget: the object which received the signal
+ * @signal_id: the ID of a signal installed on @widget
+ * @returns: %TRUE if the signal can be activated.
+ *
+ * Determines whether an accelerator that activates the signal
+ * identified by @signal_id can currently be activated.
+ * This signal is present to allow applications and derived
+ * widgets to override the default #GtkWidget handling
+ * for determining whether an accelerator can be activated.
+ */
widget_signals[CAN_ACTIVATE_ACCEL] =
g_signal_new ("can_activate_accel",
G_TYPE_FROM_CLASS (gobject_class),
@@ -2904,6 +2916,21 @@ gtk_widget_real_can_activate_accel (GtkWidget *widget,
return GTK_WIDGET_IS_SENSITIVE (widget) && GTK_WIDGET_DRAWABLE (widget) && gdk_window_is_viewable (widget->window);
}
+/**
+ * gtk_widget_can_activate_accel:
+ * @widget: a #GtkWidget
+ * @signal_id: the ID of a signal installed on @widget
+ *
+ * Determines whether an accelerator that activates the signal
+ * identified by @signal_id can currently be activated.
+ * This is done by emitting the GtkWidget::can-activate-accel
+ * signal on @widget; if the signal isn't overriden by a
+ * handler or in a derived widget, then the default check is
+ * that the widget must be sensitive, and the widget and all
+ * its parents mapped.
+ *
+ * Return value: %TRUE if the accelerator can be activated.
+ **/
gboolean
gtk_widget_can_activate_accel (GtkWidget *widget,
guint signal_id)
@@ -2933,7 +2960,7 @@ closure_accel_activate (GClosure *closure,
if (can_activate)
g_signal_emit (closure->data, aclosure->signal_id, 0);
- /* wether accelerator was handled */
+ /* whether accelerator was handled */
g_value_set_boolean (return_value, can_activate);
}