+2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
+ (gtk_font_chooser_set_font, gtk_font_chooser_get_font): Define
+ for Gtk+ versions less than 3.2.
+ (xg_get_font_name): Use those functions/macros here.
+ Reported by Frans Oilinki <moilinki@gmail.com>.
+
2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* unexmacosx.c (copy_data_segment): Copy initialized data in
#define remove_submenu(w) gtk_menu_item_remove_submenu ((w))
#endif
+#if GTK_MAJOR_VERSION < 3 || \
+ (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 2)
+#define gtk_font_chooser_dialog_new(x, y) \
+ gtk_font_selection_dialog_new (x)
+#undef GTK_FONT_CHOOSER
+#define GTK_FONT_CHOOSER(x) GTK_FONT_SELECTION_DIALOG (x)
+#define gtk_font_chooser_set_font(x, y) \
+ gtk_font_selection_dialog_set_font_name (x, y)
+#define gtk_font_chooser_get_font(x) \
+ gtk_font_selection_dialog_get_font_name (x)
+#endif
+
#ifndef HAVE_GTK3
#ifdef USE_GTK_TOOLTIP
#define gdk_window_get_screen(w) gdk_drawable_get_screen (w)
sigblock (sigmask (__SIGRTMIN));
#endif /* HAVE_PTHREAD */
- w = gtk_font_selection_dialog_new ("Pick a font");
+ w = gtk_font_chooser_dialog_new
+ ("Pick a font", GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
+
if (!default_name)
default_name = "Monospace 10";
- gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG (w),
- default_name);
+ gtk_font_chooser_set_font (GTK_FONT_CHOOSER (w), default_name);
gtk_widget_set_name (w, "emacs-fontdialog");
done = xg_dialog_run (f, w);
#endif
if (done == GTK_RESPONSE_OK)
- fontname = gtk_font_selection_dialog_get_font_name
- (GTK_FONT_SELECTION_DIALOG (w));
+ fontname = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (w));
gtk_widget_destroy (w);
return fontname;