From f774fa56ce82703a489a966886d7297054927105 Mon Sep 17 00:00:00 2001 From: Carl Sun Date: Mon, 8 Dec 2003 14:16:13 +0000 Subject: Fixes #46351 2003-12-08 Carl Sun Fixes #46351 * gui/e-timezone-entry.c (e_timezone_entry_mnemonic_activate): new function. override the member function of GtkWidget to handle nemonic_activate signal of custom class ETimezoneEntry. svn path=/trunk/; revision=23673 --- calendar/gui/e-timezone-entry.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'calendar/gui/e-timezone-entry.c') diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c index c4e2af01a7..6f6a965f7a 100644 --- a/calendar/gui/e-timezone-entry.c +++ b/calendar/gui/e-timezone-entry.c @@ -68,6 +68,8 @@ static void e_timezone_entry_class_init (ETimezoneEntryClass *class); static void e_timezone_entry_init (ETimezoneEntry *tentry); static void e_timezone_entry_destroy (GtkObject *object); +static gboolean e_timezone_entry_mnemonic_activate (GtkWidget *widget, + gboolean group_cycling); static void on_entry_changed (GtkEntry *entry, ETimezoneEntry *tentry); static void on_button_clicked (GtkWidget *widget, @@ -86,11 +88,13 @@ static void e_timezone_entry_class_init (ETimezoneEntryClass *class) { GtkObjectClass *object_class = (GtkObjectClass *) class; - + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class) ; + object_class = (GtkObjectClass*) class; parent_class = g_type_class_peek_parent (class); + widget_class->mnemonic_activate = e_timezone_entry_mnemonic_activate; timezone_entry_signals[CHANGED] = gtk_signal_new ("changed", GTK_RUN_LAST, @@ -157,6 +161,8 @@ e_timezone_entry_new (void) tentry = g_object_new (e_timezone_entry_get_type (), NULL); + GTK_WIDGET_SET_FLAGS (GTK_WIDGET(tentry), GTK_CAN_FOCUS); + return GTK_WIDGET (tentry); } @@ -296,3 +302,19 @@ e_timezone_entry_set_entry (ETimezoneEntry *tentry) g_free (name_buffer); } + +static gboolean +e_timezone_entry_mnemonic_activate (GtkWidget *widget, + gboolean group_cycling) +{ + GtkButton *button = NULL; + + if (GTK_WIDGET_CAN_FOCUS (widget)) { + button=((ETimezoneEntryPrivate*) ((ETimezoneEntry*) widget)->priv)->button; + if (button != NULL) + gtk_widget_grab_focus (button); + } + + return TRUE; +} + -- cgit