115
zenity_calendar_dialog_response (GtkWidget *widget, int response, gpointer data)
114
zenity_calendar_dialog_output (void)
117
ZenityData *zen_data;
118
116
guint day, month, year;
119
117
gchar time_string[128];
120
118
GDate *date = NULL;
120
gtk_calendar_get_date (GTK_CALENDAR (calendar), &day, &month, &year);
121
date = g_date_new_dmy (year, month + 1, day);
122
g_date_strftime (time_string, 127, zen_cal_data->date_format, date);
123
g_print ("%s\n", time_string);
130
zenity_calendar_dialog_response (GtkWidget *widget, int response, gpointer data)
132
ZenityData *zen_data;
124
136
switch (response) {
125
137
case GTK_RESPONSE_OK:
126
gtk_calendar_get_date (GTK_CALENDAR (calendar), &day, &month, &year);
127
date = g_date_new_dmy (year, month + 1, day);
128
g_date_strftime (time_string, 127, zen_cal_data->date_format, date);
129
g_print ("%s\n", time_string);
133
zenity_util_exit_code_with_data (ZENITY_OK, zen_data);
138
zenity_calendar_dialog_output ();
139
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
136
142
case GTK_RESPONSE_CANCEL:
137
143
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
147
zenity_calendar_dialog_output ();
148
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_TIMEOUT);
142
153
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);