1 # IR toolkit for tcl/tk
3 # See the file LICENSE for details.
4 # Sebastian Hammer, Adam Dickmeiss
7 # Revision 1.5 1995-06-22 13:16:28 adam
8 # Feature: SUTRS. Setting getSutrs implemented.
9 # Work on display formats.
11 # Revision 1.4 1995/06/19 08:10:21 adam
12 # Inverse highligt colours in monochrome mode.
14 # Revision 1.3 1995/06/16 12:29:00 adam
15 # Use insertWithTags on diagnostic errors.
17 # Revision 1.2 1995/06/13 14:39:06 adam
18 # Fix: if {$var != ""} doesn't work if var is a large numerical!
19 # Highlight when line format is used.
21 # Revision 1.1 1995/06/12 15:18:10 adam
22 # Work on presentation formats. These are used in the main window as well
27 proc display-line {sno no w hflag} {
28 set type [z39.$sno type $no]
30 if {[tk colormodel .] == "color"} {
31 $w tag bind r$no <Any-Enter> \
32 [list $w tag configure r$no -background gray80]
33 $w tag bind r$no <Any-Leave> \
34 [list $w tag configure r$no -background {}]
36 $w tag bind r$no <Any-Enter> \
37 [list $w tag configure r$no -background black -foreground white]
38 $w tag bind r$no <Any-Leave> \
39 [list $w tag configure r$no -background {} -foreground {}]
45 set nostr [format "%5d " $no]
46 insertWithTags $w $nostr marc-tag
49 set rtype [z39.$sno recordType $no]
50 if {$rtype == "SUTRS"} {
51 insertWithTags $w [join [z39.$sno getSutrs $no]]
54 set title [lindex [z39.$sno getMarc $no field 245 * a] 0]
55 set year [lindex [z39.$sno getMarc $no field 260 * c] 0]
56 insertWithTags $w "$title - $year\n" marc-data
58 insertWithTags $w "Unknown record type: $rtype\n" marc-id
61 } elseif {$type == "SD"} {
62 set err [lindex [z39.$sno diag $no] 1]
63 set add [lindex [z39.$sno diag $no] 2]
67 insertWithTags $w "Error ${err}${add}\n" marc-id