aboutsummaryrefslogtreecommitdiff
path: root/gtk.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2015-10-04 19:57:25 +0100
committerSimon Tatham <anakin@pobox.com>2015-10-04 19:57:25 +0100
commit27fe1c9c49deaf338b9ca146a7aca5ff905c7115 (patch)
tree21e852b851c40c60da141072f8b04f32ea4c4b08 /gtk.c
parenta94dbd27d0fbbbfbd90290647d3305ef6b6cce5b (diff)
downloadpuzzles-27fe1c9c49deaf338b9ca146a7aca5ff905c7115.zip
puzzles-27fe1c9c49deaf338b9ca146a7aca5ff905c7115.tar.gz
puzzles-27fe1c9c49deaf338b9ca146a7aca5ff905c7115.tar.bz2
puzzles-27fe1c9c49deaf338b9ca146a7aca5ff905c7115.tar.xz
GTK 3 cleanup: use GtkAboutDialog for the About box.
This is again easier than faffing about doing it manually, and as an added bonus, we get to put the largest of our icons in the box as a logo :-)
Diffstat (limited to 'gtk.c')
-rw-r--r--gtk.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gtk.c b/gtk.c
index 62d0dd9..78d8eaa 100644
--- a/gtk.c
+++ b/gtk.c
@@ -2229,6 +2229,21 @@ static void menu_config_event(GtkMenuItem *menuitem, gpointer data)
static void menu_about_event(GtkMenuItem *menuitem, gpointer data)
{
frontend *fe = (frontend *)data;
+
+#if GTK_CHECK_VERSION(3,0,0)
+ extern char *const *const xpm_icons[];
+ extern const int n_xpm_icons;
+ GdkPixbuf *icon = gdk_pixbuf_new_from_xpm_data
+ ((const gchar **)xpm_icons[n_xpm_icons-1]);
+ gtk_show_about_dialog
+ (GTK_WINDOW(fe->window),
+ "program-name", thegame.name,
+ "version", ver,
+ "comments", "Part of Simon Tatham's Portable Puzzle Collection",
+ "logo", icon,
+ (const gchar *)NULL);
+ g_object_unref(G_OBJECT(icon));
+#else
char titlebuf[256];
char textbuf[1024];
@@ -2239,6 +2254,7 @@ static void menu_about_event(GtkMenuItem *menuitem, gpointer data)
"%.500s", thegame.name, ver);
message_box(fe->window, titlebuf, textbuf, TRUE, MB_OK);
+#endif
}
static GtkWidget *add_menu_item_with_key(frontend *fe, GtkContainer *cont,