File: ctree1.tcl

package info (click to toggle)
blt 3.0~1%2B08570046%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 45,556 kB
  • sloc: ansic: 278,852; tcl: 96,434; sh: 3,410; makefile: 2,026; cpp: 374
file content (57 lines) | stat: -rw-r--r-- 1,366 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package require BLT

proc find { tree parent dir } {
    global count 
    set saved [pwd]

    cd $dir
    foreach f [glob -nocomplain *] {
	set name [file tail $f]
	if { [file type $f] == "directory" } {
	    set node [$tree insert $parent -label $name]
	    find $tree $node $f
	}
    }
    cd $saved
}

set tree [blt::tree create]
set path ../..
find $tree root $path
$tree label root [file normalize $path]
if { [file exists ../library] } {
    set blt_library ../library
}
puts [$tree label 0]
#    -postcommand {.e.m configure -width [winfo width .e] ; update} \
set myIcon ""

blt::comboentry .e \
    -font { arial 9 } \
    -textvariable myText1 \
    -iconvariable myIcon1 \
    -textwidth 20 \
    -menu .e.m \
    -exportselection yes \
    -command {puts "button pressed: [blt::grab current]"}

blt::combotree .e.m \
    -tree $tree \
    -borderwidth 1 \
    -font { arial 10 } \
    -textvariable myText1 \
    -iconvariable myIcon1 \
    -separator / \
    -height -200 \
    -linecolor grey50 \
    -yscrollbar .e.m.ybar \
    -xscrollbar .e.m.xbar

blt::tk::scrollbar .e.m.xbar
blt::tk::scrollbar .e.m.ybar

focus .e.m

bind .e.m <Unmap> { puts stderr "UNMAPPED W=%W #=%# a=%a b=%b c=%c d=%d f=%f h=%h i=%i k=%k m=%m o=%o p=%p s=%s t=%t %x=%x y=%y A=%A B=%B D=%D E=%E K=%K M=%M P=%P R=%R S=%S T=%T W=%W X=%X Y=%Y" }
blt::table . \
    .e -fill x