Added a "grab_focus" signal for widgets. When the signal is emitted, the

1998-12-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
	signal for widgets.  When the signal is emitted, the widget will
	grab the focus.  This is needed to let the user press an
	accelerator key in a dialog box and have the corresponding widget
	be focused.

	* gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
	signal.  The default handler is simply gtk_widget_grab_focus().
This commit is contained in:
Federico Mena Quintero 1998-12-14 01:32:24 +00:00 committed by Arturo Espinosa
parent 113448e030
commit 3441c3f2c4
9 changed files with 89 additions and 0 deletions

View File

@ -1,3 +1,14 @@
1998-12-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
signal for widgets. When the signal is emitted, the widget will
grab the focus. This is needed to let the user press an
accelerator key in a dialog box and have the corresponding widget
be focused.
* gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
signal. The default handler is simply gtk_widget_grab_focus().
Sun Dec 13 22:15:48 GMT 1998 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Update the following sections to the

View File

@ -1,3 +1,14 @@
1998-12-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
signal for widgets. When the signal is emitted, the widget will
grab the focus. This is needed to let the user press an
accelerator key in a dialog box and have the corresponding widget
be focused.
* gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
signal. The default handler is simply gtk_widget_grab_focus().
Sun Dec 13 22:15:48 GMT 1998 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Update the following sections to the

View File

@ -1,3 +1,14 @@
1998-12-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
signal for widgets. When the signal is emitted, the widget will
grab the focus. This is needed to let the user press an
accelerator key in a dialog box and have the corresponding widget
be focused.
* gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
signal. The default handler is simply gtk_widget_grab_focus().
Sun Dec 13 22:15:48 GMT 1998 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Update the following sections to the

View File

@ -1,3 +1,14 @@
1998-12-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
signal for widgets. When the signal is emitted, the widget will
grab the focus. This is needed to let the user press an
accelerator key in a dialog box and have the corresponding widget
be focused.
* gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
signal. The default handler is simply gtk_widget_grab_focus().
Sun Dec 13 22:15:48 GMT 1998 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Update the following sections to the

View File

@ -1,3 +1,14 @@
1998-12-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
signal for widgets. When the signal is emitted, the widget will
grab the focus. This is needed to let the user press an
accelerator key in a dialog box and have the corresponding widget
be focused.
* gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
signal. The default handler is simply gtk_widget_grab_focus().
Sun Dec 13 22:15:48 GMT 1998 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Update the following sections to the

View File

@ -1,3 +1,14 @@
1998-12-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
signal for widgets. When the signal is emitted, the widget will
grab the focus. This is needed to let the user press an
accelerator key in a dialog box and have the corresponding widget
be focused.
* gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
signal. The default handler is simply gtk_widget_grab_focus().
Sun Dec 13 22:15:48 GMT 1998 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Update the following sections to the

View File

@ -1,3 +1,14 @@
1998-12-13 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
signal for widgets. When the signal is emitted, the widget will
grab the focus. This is needed to let the user press an
accelerator key in a dialog box and have the corresponding widget
be focused.
* gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
signal. The default handler is simply gtk_widget_grab_focus().
Sun Dec 13 22:15:48 GMT 1998 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: Update the following sections to the

View File

@ -52,6 +52,7 @@ enum {
STYLE_SET,
ADD_ACCELERATOR,
REMOVE_ACCELERATOR,
GRAB_FOCUS,
EVENT,
BUTTON_PRESS_EVENT,
BUTTON_RELEASE_EVENT,
@ -387,6 +388,13 @@ gtk_widget_class_init (GtkWidgetClass *klass)
widget_signals[REMOVE_ACCELERATOR] =
gtk_accel_group_create_remove (object_class->type, GTK_RUN_LAST,
GTK_SIGNAL_OFFSET (GtkWidgetClass, remove_accelerator));
widget_signals[GRAB_FOCUS] =
gtk_signal_new ("grab_focus",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GtkWidgetClass, grab_focus),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
widget_signals[EVENT] =
gtk_signal_new ("event",
GTK_RUN_LAST,
@ -721,6 +729,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->style_set = gtk_widget_style_set;
klass->add_accelerator = (void*) gtk_accel_group_handle_add;
klass->remove_accelerator = (void*) gtk_accel_group_handle_remove;
klass->grab_focus = gtk_widget_grab_focus;
klass->event = NULL;
klass->button_press_event = NULL;
klass->button_release_event = NULL;

View File

@ -272,6 +272,9 @@ struct _GtkWidgetClass
GtkAccelGroup *accel_group,
guint accel_key,
GdkModifierType accel_mods);
/* explicit focus */
void (* grab_focus) (GtkWidget *widget);
/* events */
gint (* event) (GtkWidget *widget,