summaryrefslogtreecommitdiff
path: root/gui/gui.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-19 21:30:58 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-19 21:30:58 -0300
commitc1a77a0dce1b0414a42b9dc52154f537e0b4d12f (patch)
tree3156caa84a006eb2d245e7540dff3d8a2819cbcd /gui/gui.c
parented5d290d4dd7a1409a5cbb2997b3c9aedc7616f0 (diff)
downloadeeshow-c1a77a0dce1b0414a42b9dc52154f537e0b4d12f.tar.gz
eeshow-c1a77a0dce1b0414a42b9dc52154f537e0b4d12f.tar.bz2
eeshow-c1a77a0dce1b0414a42b9dc52154f537e0b4d12f.zip
eeshow/gui/gui.c (gui): show build commit in window title
Diffstat (limited to 'gui/gui.c')
-rw-r--r--gui/gui.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gui/gui.c b/gui/gui.c
index ec738ca..229a14d 100644
--- a/gui/gui.c
+++ b/gui/gui.c
@@ -17,13 +17,16 @@
* https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html
*/
+#define _GNU_SOURCE /* for asprintf */
#include <stddef.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include <gtk/gtk.h>
+#include "version.h"
#include "misc/util.h"
#include "misc/diag.h"
#include "file/git-hist.h"
@@ -380,6 +383,7 @@ static void get_history(struct gui_ctx *ctx, const char *sch_name, int limit)
int gui(unsigned n_args, char **args, bool recurse, int limit)
{
GtkWidget *window;
+ char *title;
struct gui_ctx ctx = {
.zoom = 4, /* scale by 1 / 16 */
.hist = NULL,
@@ -403,7 +407,8 @@ int gui(unsigned n_args, char **args, bool recurse, int limit)
gtk_container_add(GTK_CONTAINER(window), ctx.da);
gtk_window_set_default_size(GTK_WINDOW(window), 640, 480);
- gtk_window_set_title(GTK_WINDOW(window), "eeshow");
+ if (asprintf(&title, "eeshow (rev %s)", version)) {};
+ gtk_window_set_title(GTK_WINDOW(window), title);
gtk_widget_set_events(ctx.da,
GDK_EXPOSE | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);