summaryrefslogtreecommitdiff
path: root/getxbookgui.tcl
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-11-08 23:01:19 +0000
committerNick White <git@njw.me.uk>2011-11-08 23:01:19 +0000
commit5ba1b587618ed09c169655f722bd72d9db82343b (patch)
tree400b3114bcb5a29e6d36d9848f1821e829119b78 /getxbookgui.tcl
parentfca6360e428cfd63c0d8f9fc30b83d27a611bf4a (diff)
Add gui starpack build rule
Diffstat (limited to 'getxbookgui.tcl')
-rwxr-xr-xgetxbookgui.tcl30
1 files changed, 30 insertions, 0 deletions
diff --git a/getxbookgui.tcl b/getxbookgui.tcl
new file mode 100755
index 0000000..56b6e63
--- /dev/null
+++ b/getxbookgui.tcl
@@ -0,0 +1,30 @@
+#!/usr/bin/tclsh
+# See COPYING file for copyright and license details.
+package require Tk
+
+set bin [list getgbook getabook]
+
+proc go {} {
+ if { [.id get] == "" } { return }
+ set cmd "[.bin get [.bin curselection]] [.id get]"
+ .dl configure -state disabled -text "downloading"
+ update
+ set out [open "|$cmd 2>@1" "r"]
+ while {![eof $out]} {
+ set a [gets $out]
+ if { $a != "" } { .st configure -text $a }
+ update
+ }
+ .dl configure -state normal -text "download"
+ .st configure -text ""
+}
+
+label .lab -text "book id"
+entry .id
+listbox .bin -listvariable bin -exportselection 0
+.bin selection set 0
+button .dl -text "download" -command go
+label .st -relief sunken -width 20
+
+pack .lab .id .bin .dl .st
+bind . <Return> go