From 0e5cfe78a5161e1c98e69f4670552e0d381b3d30 Mon Sep 17 00:00:00 2001 From: Arturo Espinosa Aldama Date: Wed, 15 Apr 1998 02:40:24 +0000 Subject: New widget for the year view. added required compilation of the new files. 1998-04-14 Arturo Espinosa Aldama * gncal-year-view.[hc]: New widget for the year view. * Makefile.am: added required compilation of the new files. svn path=/trunk/; revision=134 --- calendar/gncal-full-day.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'calendar/gncal-full-day.c') diff --git a/calendar/gncal-full-day.c b/calendar/gncal-full-day.c index ce64db9173..8c3bf31db2 100644 --- a/calendar/gncal-full-day.c +++ b/calendar/gncal-full-day.c @@ -331,13 +331,27 @@ child_focus_out (GtkWidget *widget, GdkEventFocus *event, gpointer data) /* Notify calendar of change */ - fullday = gtk_object_get_user_data (GTK_OBJECT (widget)); + fullday = GNCAL_FULL_DAY (widget->parent); gnome_calendar_object_changed (fullday->calendar, child->ico, CHANGE_SUMMARY); return FALSE; } +static gint +child_key_press (GtkWidget *widget, GdkEventKey *event, gpointer data) +{ + if (event->keyval != GDK_Escape) + return FALSE; + + /* If user pressed Esc, un-focus the child by focusing the fullday widget */ + + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + gtk_widget_grab_focus (widget->parent); + + return FALSE; +} + static Child * child_new (GncalFullDay *fullday, iCalObject *ico) { @@ -353,8 +367,6 @@ child_new (GncalFullDay *fullday, iCalObject *ico) child->width = 0; child->height = 0; - gtk_object_set_user_data (GTK_OBJECT (child->widget), fullday); - child_range_changed (fullday, child); /* We set the i-beam cursor and the initial summary text upon realization */ @@ -371,6 +383,10 @@ child_new (GncalFullDay *fullday, iCalObject *ico) (GtkSignalFunc) child_focus_out, child); + gtk_signal_connect (GTK_OBJECT (child->widget), "key_press_event", + (GtkSignalFunc) child_key_press, + child); + /* Finish setup */ gtk_text_set_editable (GTK_TEXT (child->widget), TRUE); -- cgit