OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / SGI / util / SGI / lib / blt2.4 / demos / hier4
1 #!/home/people/tkys/Eos/util/SGI/bin/bltwish
2 #!../bltwish
3
4 source bltDemo.tcl
5
6 proc AddDirEntries { w dir } {
7     if { [file isdirectory $dir] } {
8         set files [glob -nocomplain $dir/*] 
9         eval $w insert end [lsort $files]
10         set subdirs [glob -nocomplain $dir/*/]
11         eval $w entry configure [lsort $subdirs] -gadget yes
12     }
13 }
14
15 image create photo activeIcon -file ./images/ofolder.gif
16 image create photo normalIcon -file ./images/folder.gif
17
18 image create photo openGadget -file ./images/mini-book2.gif
19 image create photo closeGadget -file ./images/mini-book1.gif
20
21 image create photo bgTexture -file ./images/rain.gif
22
23 set imageList {}
24 foreach f [glob ./images/mini-*.gif] {
25     lappend imageList [image create photo -file $f]
26 }
27
28 #option add *Hierbox.Tile       bgTexture
29 option add *Hierbox.ScrollTile  yes
30 option add *Hierbox.cursor crosshair
31
32 option add *icons       "normalIcon activeIcon"
33
34 hierbox .h  \
35     -yscrollcommand { .vs set } \
36     -xscrollcommand { .hs set } \
37     -activebackground lightskyblue1 \
38     -selectbackground lightskyblue2
39
40
41 scrollbar .vs -orient vertical -command { .h yview }
42 scrollbar .hs -orient horizontal -command { .h xview }
43 button .test -text Test -command {
44     set index [.h curselection]
45     set names [eval .h get -full $index]
46     puts "selected names are $names"
47 }
48
49 table . \
50     0,0 .h  -fill both \
51     0,1 .vs -fill y \
52     1,0 .hs -fill x \
53     2,0 .test 
54
55 table configure . c1 r1 -resize none
56
57 .h configure -autocreate yes 
58 focus .h
59 .h insert end { The Quick Brown Fox Jumped Over the }
60 .h entry configure root -label {[Root]}