From 2b57396a362a70d7a1cae36a246e682181b5f023 Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 7 Sep 2011 22:32:08 +0100 Subject: Add getxbookgui to Makefile etc --- Makefile | 2 +- README | 3 ++- getxbookgui | 24 ++++++++++++++++++++++++ gui.tcl | 24 ------------------------ 4 files changed, 27 insertions(+), 26 deletions(-) create mode 100755 getxbookgui delete mode 100755 gui.tcl diff --git a/Makefile b/Makefile index f09cdb8..dfe3451 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ NAME = getxbook SRC = getgbook.c LIB = util.o -SCRIPTS = makebookpdf.sh +SCRIPTS = makebookpdf.sh getxbookgui DOC = README COPYING LEGAL BIN = $(SRC:.c=) diff --git a/README b/README index 31b78fe..2918cfd 100644 --- a/README +++ b/README @@ -41,4 +41,5 @@ form of tyranny over the mind of man." Each tool is written in around 200 lines of portable C code, with no dependencies beyond libc. They should work well on Linux, BSDs, OSX -and Windows. +and Windows. There is also an optional graphical interface, written +in Tcl/Tk. diff --git a/getxbookgui b/getxbookgui new file mode 100755 index 0000000..08d3f04 --- /dev/null +++ b/getxbookgui @@ -0,0 +1,24 @@ +#!/usr/bin/tclsh +# See COPYING file for copyright and license details. +package require Tk + +set bin [list getgbook getabook] + +proc go {} { + set cmd "[.bin get [.bin curselection]] [.id get]" + set out [open "|$cmd" "r"] + while {![eof $out]} { + .txt insert end [gets $out] + .txt insert end "\n" + update + } +} + +label .lab -text "book id" +entry .id +listbox .bin -listvariable bin -exportselection 0 +.bin selection set 0 +button .dl -text "download" -command go +text .txt + +pack .lab .id .bin .dl .txt diff --git a/gui.tcl b/gui.tcl deleted file mode 100755 index 08d3f04..0000000 --- a/gui.tcl +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/tclsh -# See COPYING file for copyright and license details. -package require Tk - -set bin [list getgbook getabook] - -proc go {} { - set cmd "[.bin get [.bin curselection]] [.id get]" - set out [open "|$cmd" "r"] - while {![eof $out]} { - .txt insert end [gets $out] - .txt insert end "\n" - update - } -} - -label .lab -text "book id" -entry .id -listbox .bin -listvariable bin -exportselection 0 -.bin selection set 0 -button .dl -text "download" -command go -text .txt - -pack .lab .id .bin .dl .txt -- cgit v1.2.3