diff options
author | Arturo Espinosa <unammx@src.gnome.org> | 1998-04-02 10:18:42 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1998-04-02 10:18:42 +0800 |
commit | 4750b90ad18f4f59fa19b839550d6397f5dffbfd (patch) | |
tree | a2d62941f88d3aedb6509b4883e08c82e13ed1cc /calendar/gui/gnome-cal.c | |
parent | 9bc7db5333a2319828768142c527d3fb64afd999 (diff) | |
download | gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar.gz gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar.bz2 gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar.lz gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar.xz gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar.zst gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.zip |
GnomeCalendar toplevel GnomeApp; versit code -mig
svn path=/trunk/; revision=89
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c new file mode 100644 index 0000000000..333931a5a2 --- /dev/null +++ b/calendar/gui/gnome-cal.c @@ -0,0 +1,92 @@ +/* + * GnomeCalendar widget + * Copyright (C) 1998 the Free Software Foundation + * + * Author: Miguel de Icaza (miguel@kernel.org) + */ + +#include <gnome.h> +#include "calendar.h" +#include "gnome-cal.h" +#include "views.h" + +static void gnome_calendar_init (GnomeCalendar *gcal); + +GnomeApp *parent_class; + +guint +gnome_calendar_get_type (void) +{ + static guint gnome_calendar_type = 0; + if(!gnome_calendar_type) { + GtkTypeInfo gnome_calendar_info = { + "GnomeCalendar", + sizeof(GnomeCalendar), + sizeof(GnomeCalendarClass), + (GtkClassInitFunc) NULL, + (GtkObjectInitFunc) gnome_calendar_init, + (GtkArgSetFunc) NULL, + (GtkArgGetFunc) NULL, + }; + gnome_calendar_type = gtk_type_unique(gnome_app_get_type(), &gnome_calendar_info); + parent_class = gtk_type_class (gnome_app_get_type()); + } + return gnome_calendar_type; +} + +static void +setup_widgets (GnomeCalendar *gcal) +{ + GtkWidget *notebook; + GtkWidget *day_view, *week_view, *year_view, *task_view; + + notebook = gtk_notebook_new (); + day_view = day_view_create (gcal); + week_view = week_view_create (gcal); + year_view = year_view_create (gcal); + task_view = tasks_create (gcal); + + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), day_view, gtk_label_new (_("Day View"))); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), week_view, gtk_label_new (_("Week View"))); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), year_view, gtk_label_new (_("Year View"))); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), task_view, gtk_label_new (_("Tasks"))); + + gtk_widget_show_all (notebook); + + gnome_app_set_contents (GNOME_APP (gcal), notebook); + +} + +static void +gnome_calendar_init(GnomeCalendar *gcal) +{ + gcal->cal = 0; + + setup_widgets (gcal); +} + +GtkWidget * +gnome_calendar_new (char *title) +{ + GtkWidget *retval; + GnomeCalendar *gcal; + GnomeApp *app; + + retval = gtk_type_new (gnome_calendar_get_type ()); + app = GNOME_APP (retval); + gcal = GNOME_CALENDAR (retval); + + app->name = g_strdup ("calendar"); + app->prefix = g_copy_strings ("/", app->name, "/", NULL); + + gtk_window_set_title(GTK_WINDOW(retval), title); + + gcal->cal = calendar_new (title); + return retval; +} + +void +gnome_calendar_load (char *file) +{ + +} |