{
GtkWidget *btn;
GtkWidget *btn_label;
-#if !GTK_CHECK_VERSION(3, 0, 0)
GdkColormap *cmap;
gboolean success[2];
-#endif
GdkColor uri_color[2] = {{0, 0, 0, 0xffff}, {0, 0xffff, 0, 0}};
gchar *local_url = NULL;
if (!url)
btn = gtk_button_new_with_label(label?label:url);
gtk_button_set_relief(GTK_BUTTON(btn), GTK_RELIEF_NONE);
btn_label = gtk_bin_get_child(GTK_BIN((btn)));
-#if !GTK_CHECK_VERSION(3, 0, 0)
cmap = gdk_drawable_get_colormap(gtk_widget_get_window(window));
gdk_colormap_alloc_colors(cmap, uri_color, 2, FALSE, TRUE, success);
if (success[0] == TRUE && success[1] == TRUE) {
-#endif
GtkStyle *style;
gtk_widget_ensure_style(btn_label);
style = gtk_style_copy
style->fg[GTK_STATE_PRELIGHT] = uri_color[0];
gtk_widget_set_style(btn_label, style);
g_object_unref(style);
-#if !GTK_CHECK_VERSION(3, 0, 0)
} else
g_warning("color allocation failed");
-#endif
g_signal_connect(G_OBJECT(btn), "enter",
G_CALLBACK(link_btn_enter), window);
return TRUE;
}
+
+void gtk_calendar_select_today(GtkCalendar *calendar)
+{
+ time_t t = time (NULL);
+ struct tm buft;
+ struct tm *lt = localtime_r (&t, &buft);
+
+ mktime(lt);
+ gtk_calendar_select_day(calendar, lt->tm_mday);
+ gtk_calendar_select_month(calendar, lt->tm_mon, lt->tm_year + 1900);
+}