static void reset_details (CalendarData *data) { g_hash_table_remove_all (data->details_table); gtk_widget_queue_resize (data->calendar_widget); calendar_update_details (data); }
static void calendar_day_selected (GtkWidget *widget, CalendarData *data) { char buffer[256] = "day_selected: "; calendar_date_to_string (data, buffer+14, 256-14); calendar_set_signal_strings (buffer, data); calendar_update_details (data); }
static void demonstrate_details (CalendarData *data) { static char *rainbow[] = { "#900", "#980", "#390", "#095", "#059", "#309", "#908" }; GtkCalendar *calendar = GTK_CALENDAR (data->calendar_widget); gint row, col; for (row = 0; row < 6; ++row) for (col = 0; col < 7; ++col) { gint year, month, day; gchar *detail; // year = calendar->year; // month = calendar->month; // month += calendar->day_month[row][col]; // day = calendar->day[row][col]; if (month < 1) { month += 12; year -= 1; } else if (month > 12) { month -= 12; year += 1; } detail = g_strdup_printf ("<span color='%s'>yadda\n" "(%04d-%02d-%02d)</span>", rainbow[(day - 1) % 7], year, month, day); calendar_set_detail (data, year, month - 1, day, detail); } gtk_widget_queue_resize (data->calendar_widget); calendar_update_details (data); }
static void demonstrate_details (CalendarData *data) { static char *rainbow[] = { "#900", "#980", "#390", "#095", "#059", "#309", "#908" }; GtkCalendar *calendar = GTK_CALENDAR (data->calendar_widget); guint year, month, day; gchar *detail; gtk_calendar_get_date (calendar, &year, &month, &day); for (day = 0; day < 29; ++day) { detail = g_strdup_printf ("<span color='%s'>yadda\n" "(%04d-%02d-%02d)</span>", rainbow[(day - 1) % 7], year, month, day); calendar_set_detail (data, year, month, day, detail); } gtk_widget_queue_resize (data->calendar_widget); calendar_update_details (data); }