From 95b97539f2cd6e23cd05021e9fe69400d26fd2e3 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 21 Oct 2011 15:07:45 +0200 Subject: [PATCH] tpdfview: Set window title to 'tpdfview: '. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … applying basename() to the filename specified on the command-line. --- src/tpdfview.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tpdfview.c b/src/tpdfview.c index d46aef0..b92d544 100644 --- a/src/tpdfview.c +++ b/src/tpdfview.c @@ -168,8 +168,12 @@ main(int argc, char **argv) GtkWidget *win = NULL; GtkWidget *tpdfv = NULL; + char win_title[1024]; + GdkColor bg_color; + char *filename; + gtk_init(&argc, &argv); while (42) { @@ -195,7 +199,9 @@ main(int argc, char **argv) exit_usage(argv[0], 1); } - tpdfv = gtk_tpdfv_new(argv[optind]); + filename = argv[optind]; + + tpdfv = gtk_tpdfv_new(filename); if (! tpdfv) return 1; @@ -203,6 +209,10 @@ main(int argc, char **argv) if (! win) return 1; + snprintf(win_title, sizeof(win_title), "tpdfview: %s", + basename(filename)); + gtk_window_set_title(GTK_WINDOW(win), win_title); + gtk_container_add(GTK_CONTAINER(win), tpdfv); g_signal_connect(G_OBJECT(win), "destroy", -- 2.30.2