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
29 proc AddDirEntries { w dir } {
30 if { [file isdirectory $dir] } {
31 set files [glob -nocomplain $dir/*]
32 eval $w insert end [lsort $files]
33 set subdirs [glob -nocomplain $dir/*/]
34 eval $w entry configure [lsort $subdirs] -button yes
39 foreach f [glob ./images/mini-*.gif] {
40 lappend imageList [image create photo -file $f]
45 #option add *Hierbox.Tile bgTexture
46 option add *Hierbox.TileOffset yes
48 option add *forceGadgets no
49 option add *Hierbox.openCommand {
50 AddDirEntries %W "$top/%P"
52 option add *Hierbox.closeCommand {
53 eval %W delete %n 0 end
56 image create photo openFolder -file images/open.gif
57 image create photo closeFolder -file images/close.gif
59 option add *Hierbox.icons "closeFolder openFolder"
61 #option add *Hierbox.Button.activeForeground red
62 #option add *Hierbox.bindTags "Label all"
65 -selectmode multiple \
67 -yscrollcommand { .vs set } \
68 -xscrollcommand { .hs set }
70 .h button configure -activebackground grey92
71 scrollbar .vs -orient vertical -command { .h yview }
72 scrollbar .hs -orient horizontal -command { .h xview }
73 button .test -text Test -command {
74 set index [.h curselection]
75 set names [eval .h get -full $index]
76 puts "selected names are $names"
79 button .quit -text Quit -command { exit 0 }
84 0,1 .vs -fill y 1,0 .hs -fill x \
87 table configure . c1 r1 r2 r3 -resize none
89 .h configure -separator "/" -trim $top \
92 #.h entry configure 0 -label [file tail $top]
96 set nodes [.h find -glob -name *.c]
97 eval .h entry configure $nodes -labelcolor red
99 wm protocol . WM_DELETE_WINDOW { destroy . }