summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgetxbookgui14
1 files changed, 9 insertions, 5 deletions
diff --git a/getxbookgui b/getxbookgui
index 2328f73..92d98b7 100755
--- a/getxbookgui
+++ b/getxbookgui
@@ -5,14 +5,18 @@ 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]} {
- .txt insert end [gets $out]
- .txt insert end "\n"
+ set a [gets $out]
+ if { $a != "" } { .st configure -text $a }
update
}
- .txt insert end "done"
+ .dl configure -state normal -text "download"
+ .st configure -text ""
}
label .lab -text "book id"
@@ -20,6 +24,6 @@ entry .id
listbox .bin -listvariable bin -exportselection 0
.bin selection set 0
button .dl -text "download" -command go
-text .txt
+label .st -relief sunken -width 20
-pack .lab .id .bin .dl .txt
+pack .lab .id .bin .dl .st