summaryrefslogtreecommitdiff
path: root/getxbookgui
blob: 504b6bb84ad3109d94d38c32ab59e4827341fe5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/tclsh8.5
# 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
	}
	.txt insert end "done"
}

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