From: Sebastian Harl Date: Fri, 21 Oct 2011 13:07:45 +0000 (+0200) Subject: tpdfview: Set window title to 'tpdfview: '. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=95b97539f2cd6e23cd05021e9fe69400d26fd2e3;p=tpdfview.git tpdfview: Set window title to 'tpdfview: '. … applying basename() to the filename specified on the command-line. --- 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",