From ae6031ecceb5dc02d5dafad6b31378021f358338 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 25 Apr 2000 19:50:54 +0000 Subject: hook for widget destroy -- used to unref the CalClient so wombat knows we * gui/gnome-cal.c (gnome_calendar_destroy): hook for widget destroy -- used to unref the CalClient so wombat knows we are gone. (gnome_calendar_class_init): added a class init for this widget. svn path=/trunk/; revision=2613 --- calendar/ChangeLog | 4 ++++ calendar/gui/calendar-commands.c | 10 ---------- calendar/gui/gnome-cal.c | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index d0a736019b..64bed82926 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,9 @@ 2000-04-25 Seth Alves + * gui/gnome-cal.c (gnome_calendar_destroy): hook for widget + destroy -- used to unref the CalClient so wombat knows we are gone. + (gnome_calendar_class_init): added a class init for this widget. + * gui/e-day-view.c (e_day_view_update_event): allow for null ico * gui/e-week-view.c (e_week_view_update_event): allow for null ico diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c index 4820c2892e..254030c675 100644 --- a/calendar/gui/calendar-commands.c +++ b/calendar/gui/calendar-commands.c @@ -338,16 +338,6 @@ close_cmd (BonoboUIHandler *uih, void *user_data, const char *path) GnomeCalendar *gcal = GNOME_CALENDAR (user_data); all_calendars = g_list_remove (all_calendars, gcal); - /* DELETE - FIXME -- what do i do here? - if (gcal->cal->modified){ - if (!gcal->cal->filename) - save_calendar_cmd (widget, gcal); - else - calendar_save (gcal->cal, gcal->cal->filename); - } - */ - gtk_widget_destroy (GTK_WIDGET (gcal)); active_calendars--; diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 0627d1bd89..763fd5eac4 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -30,6 +30,9 @@ +static void gnome_calendar_class_init (GnomeCalendar *class); +static void gnome_calendar_destroy (GtkObject *object); + static void gnome_calendar_update_view_times (GnomeCalendar *gcal, GtkWidget *page); static void gnome_calendar_update_gtk_calendar (GnomeCalendar *gcal); @@ -40,6 +43,8 @@ static void gnome_calendar_on_month_changed (GtkCalendar *calendar, static GtkVBoxClass *parent_class; + + guint gnome_calendar_get_type (void) { @@ -49,7 +54,7 @@ gnome_calendar_get_type (void) "GnomeCalendar", sizeof(GnomeCalendar), sizeof(GnomeCalendarClass), - (GtkClassInitFunc) NULL, + (GtkClassInitFunc) gnome_calendar_class_init, (GtkObjectInitFunc) NULL, (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL, @@ -65,6 +70,33 @@ gnome_calendar_get_type (void) return gnome_calendar_type; } + +static void +gnome_calendar_class_init (GnomeCalendar *class) +{ + GtkObjectClass *object_class; + object_class = (GtkObjectClass *) class; + object_class->destroy = gnome_calendar_destroy; +} + + +static void +gnome_calendar_destroy (GtkObject *object) +{ + GnomeCalendar *gcal; + + g_return_if_fail (object != NULL); + g_return_if_fail (GNOME_IS_CALENDAR (object)); + + gcal = GNOME_CALENDAR (object); + + gtk_object_unref (GTK_OBJECT (gcal->client)); + + if (GTK_OBJECT_CLASS (parent_class)->destroy) + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); +} + + static void setup_widgets (GnomeCalendar *gcal) { -- cgit v1.2.3