From 7c3c8af7707a06a114d4163b8ee98ff7868a7a8d Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 11 Oct 2011 23:38:58 +0100 Subject: Simplify gui status usage --- getxbookgui | 14 +++++++++----- 1 file 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 -- cgit v1.2.3