diff options
author | Nick White <git@njw.me.uk> | 2011-10-11 23:38:58 +0100 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2011-10-11 23:38:58 +0100 |
commit | 7c3c8af7707a06a114d4163b8ee98ff7868a7a8d (patch) | |
tree | 61b5f9d32491d883b7978b8f382cc52f809b02d5 | |
parent | e79fe370ec4a2478046a4dda7026fcadaefcf931 (diff) |
Simplify gui status usage
-rwxr-xr-x | getxbookgui | 14 |
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 |