4 # --------------------------------------------------------------------------
5 # Starting with Tcl 8.x, the BLT commands are stored in their own
6 # namespace called "blt". The idea is to prevent name clashes with
7 # Tcl commands and variables from other packages, such as a "table"
8 # command in two different packages.
10 # You can access the BLT commands in a couple of ways. You can prefix
11 # all the BLT commands with the namespace qualifier "blt::"
14 # blt::table . .g -resize both
16 # or you can import all the command into the global namespace.
18 # namespace import blt::*
20 # table . .g -resize both
22 # --------------------------------------------------------------------------
23 if { $tcl_version >= 8.0 } {
24 namespace import blt::*
25 namespace import -force blt::tile::*
27 source scripts/demo.tcl
33 image create photo bgTexture -file ./images/rain.gif
36 foreach f [glob ./images/mini-*.gif] {
37 lappend imageList [image create photo -file $f]
40 #option add *Hierbox.Tile bgTexture
41 option add *Hierbox.ScrollTile yes
43 option add *xHierbox.openCommand {
44 set path /home/gah/src/blt/%P
45 if { [file isdirectory $path] } {
47 set files [glob -nocomplain * */. ]
49 eval %W insert -at %n end $files
54 option add *xHierbox.closeCommand {
55 eval %W delete %n 0 end
58 image create photo openFolder -file images/open.gif
59 image create photo closeFolder -file images/close.gif
61 option add *Hierbox.icons "closeFolder openFolder"
63 image create photo openFolder2 -file images/open2.gif
64 image create photo closeFolder2 -file images/close2.gif
66 option add *Hierbox.activeIcons "closeFolder2 openFolder2"
69 -activebackground blue \
70 -yscrollcommand { .vs set } \
71 -xscrollcommand { .hs set }
73 scrollbar .vs -orient vertical -command { .h yview }
74 scrollbar .hs -orient horizontal -command { .h xview }
80 table configure . c1 r1 -resize none
82 proc DoFind { dir path } {
87 lappend fileList $path
88 foreach f [lsort [glob -nocomplain *]] {
89 set entry [file join $path $f]
90 lappend fileList $entry
91 if { [file isdirectory $f] } {
107 .h configure -separator "/" -autocreate yes
109 proc GetAbsolutePath { dir } {
116 .h entry configure root -label [file tail [GetAbsolutePath $top]]
117 .h configure -bg grey90
119 regsub -all {\.\./*} [Find $top] {} fileList
120 eval .h insert end $fileList
121 .h configure -bg white
123 .h find -glob -name *.gif -exec {
124 %W entry configure %n -image [image create photo -file $top/%P]
129 set nodes [.h find -glob -name *.c]
130 eval .h entry configure $nodes -labelcolor red