File: scrollset4.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,306 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
#!../src/bltwish

package require BLT

image create picture label1 -file ./images/mini-book1.gif
image create picture label2 -file ./images/mini-book2.gif
image create picture testImage -file ./images/txtrflag.gif

blt::scrollset .ss \
    -xviewcommand { .ss.t view } \
    -xscrollbar .ss.xsbar \
    -yscrollbar .ss.ysbar \
    -window .ss.t 

blt::tk::scrollbar .ss.ysbar -orient vertical 
blt::tk::scrollbar .ss.xsbar -orient horizontal 

blt::tabset .ss.t \
    -font { Arial 8 } \
    -side right \
    -tabwidth same \
    -scrollcommand { .ss xset } \
    -scrollincrement 1 

blt::table . \
    .ss 0,0 -fill both 

focus .ss.t

set attributes {
    graph1 "Graph \#1" pink	
    graph2 "Graph \#2" lightblue	
    graph3 "Graph \#3" orange
    graph5 "Graph \#5" yellow	
    barchart2 "Barchart \#2" green
}

foreach { name label color } $attributes {
    .ss.t insert end $name -text $label 
}

blt::tk::label .ss.t.l -image testImage
.ss.t insert end Image -window .ss.t.l

.ss.t focus 0

foreach file { graph1 graph2 graph3 graph5 barchart2 } {
    namespace eval $file {
	if { [string match graph* $file] } {
	    set graph [blt::graph .ss.t.$file]
	} else {
	    set graph [blt::barchart .ss.t.$file]
	}
	source scripts/$file.tcl
	.ss.t tab configure $file -window $graph -fill both 
    }
}