#!/usr/local/bin/wish
-f
# + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #
# Tel -
script for binding, listing, scrolloing, filling and
select #
# + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #
# listbox .lb1 -exportselection
1 -selectmode browse –yscroll ".sbl set"
listbox .lbl -exportselection 1 -selectmode
single –yscroll ".sbl set"
#
bind .lbl <ButtonRelease-1> {show}
#
scrollbar
.sb1 -relief sunken -command ".lb1 yview"
pack .sb1
.lb1 -side right -fill y -expand yes
#
label .l1
-relief sunken -text "String von Listbox"
pack .l1
button
.b1 -text "EXIT" -command {exit}
pack .bl
#
# Vorbereitung fuer die Listbox
#
exec cut
-f 3- rgb.txt > rgb1.txt
#
#
Filling of Listbox
#
set rgb [open rgb1.txt r]
while {[eof $rgb] == 0} {
set colorstr [gets $rgb]
if {$colorstr != ""} {
.lb1
insert 0 $colorstr
}
}
.lb1
delete 0
close $rgb
#
#
# procedure for index display in label #
#
proc show
{} {
global w
global
text
set w
[.lb1 curselection]
set text
[.lb1 get $w]
.l1
configure -text $text -bg
$text
}