1#!/usr/local/bin/bltwish 2 3package require BLT 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. 9# 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::" 12# 13# blt::graph .g 14# blt::table . .g -resize both 15# 16# or you can import all the command into the global namespace. 17# 18# namespace import blt::* 19# graph .g 20# table . .g -resize both 21# 22# -------------------------------------------------------------------------- 23if { $tcl_version >= 8.0 } { 24 namespace import blt::* 25 namespace import -force blt::tile::* 26} 27source scripts/demo.tcl 28#bltdebug 100 29 30image create photo label1 -file ./images/mini-book1.gif 31image create photo label2 -file ./images/mini-book2.gif 32image create photo testImage -file ./images/txtrflag.gif 33 34tabnotebook .tnb \ 35 -textside right \ 36 -slant both \ 37 -side right \ 38 -samewidth yes \ 39 -highlightcolor yellow \ 40 -tiers 5 \ 41 -scrollcommand { .s set } \ 42 -scrollincrement 1 43 44label .tnb.l -image testImage 45 46set attributes { 47 "Graph \#1" pink 48 "Graph \#2" lightblue 49 "Graph \#3" orange 50 "Graph \#5" yellow 51 "Barchart \#2" green 52} 53 54foreach { label color } $attributes { 55 .tnb insert end -text $label \ 56 -selectbackground ${color}3 \ 57 -background ${color}3 \ 58 -activebackground ${color}2 59} 60 61.tnb insert end -selectbackground salmon2 -background salmon3 \ 62 -selectbackground salmon3 -activebackground salmon2 -window .tnb.l 63 64set tabLabels { 65 Aarhus Aaron Ababa aback abaft abandon abandoned abandoning 66 abandonment abandons abase abased abasement abasements abases 67 abash abashed abashes abashing abasing abate abated abatement 68 abatements abater abates abating Abba abbe abbey abbeys abbot 69 abbots Abbott abbreviate abbreviated abbreviates abbreviating 70 abbreviation abbreviations Abby abdomen abdomens abdominal 71 abduct abducted abduction abductions abductor abductors abducts 72 Abe abed Abel Abelian Abelson Aberdeen Abernathy aberrant 73 aberration aberrations abet abets abetted abetter abetting 74 abeyance abhor abhorred abhorrent abhorrer abhorring abhors 75 abide abided abides abiding Abidjan Abigail Abilene abilities 76 ability abject abjection abjections abjectly abjectness abjure 77 abjured abjures abjuring ablate ablated ablates ablating 78 ablation ablative ablaze able abler ablest ably Abner abnormal 79 abnormalities abnormality abnormally Abo aboard abode abodes 80 abolish abolished abolisher abolishers abolishes abolishing 81 abolishment abolishments abolition abolitionist abolitionists 82 abominable abominate aboriginal aborigine aborigines abort 83 aborted aborting abortion abortions abortive abortively aborts 84 Abos abound abounded abounding abounds about above aboveboard 85 aboveground abovementioned abrade abraded abrades abrading 86 Abraham Abram Abrams Abramson abrasion abrasions abrasive 87 abreaction abreactions abreast abridge abridged abridges 88 abridging abridgment abroad abrogate abrogated abrogates 89 abrogating abrupt abruptly abruptness abscess abscessed 90 abscesses abscissa abscissas abscond absconded absconding 91 absconds absence absences absent absented absentee 92 absenteeism absentees absentia absenting absently absentminded 93 absents absinthe absolute absolutely absoluteness absolutes 94 absolution absolve absolved absolves absolving absorb 95 absorbed absorbency absorbent absorber absorbing absorbs 96 absorption absorptions absorptive abstain abstained abstainer 97 abstaining abstains abstention abstentions abstinence 98 abstract abstracted abstracting abstraction abstractionism 99 abstractionist abstractions abstractly abstractness 100 abstractor abstractors abstracts abstruse abstruseness 101 absurd absurdities absurdity absurdly Abu abundance abundant 102 abundantly abuse abused abuses abusing abusive abut abutment 103 abuts abutted abutter abutters abutting abysmal abysmally 104 abyss abysses Abyssinia Abyssinian Abyssinians acacia 105 academia academic academically academics academies academy 106 Acadia Acapulco accede acceded accedes accelerate accelerated 107 accelerates accelerating acceleration accelerations 108 accelerator accelerators accelerometer accelerometers accent 109 accented accenting accents accentual accentuate accentuated 110 accentuates accentuating accentuation accept acceptability 111 acceptable acceptably acceptance acceptances accepted 112 accepter accepters accepting acceptor acceptors accepts 113 access accessed accesses accessibility accessible accessibly 114 accessing accession accessions accessories accessors 115 accessory accident accidental accidentally accidently 116 accidents acclaim acclaimed acclaiming acclaims acclamation 117 acclimate acclimated acclimates acclimating acclimatization 118 acclimatized accolade accolades accommodate accommodated 119 accommodates accommodating accommodation accommodations 120 accompanied accompanies accompaniment accompaniments 121 accompanist accompanists accompany accompanying accomplice 122 accomplices accomplish accomplished accomplisher accomplishers 123 accomplishes accomplishing accomplishment accomplishments 124 accord accordance accorded accorder accorders according 125 accordingly accordion accordions accords accost accosted 126 accosting accosts account accountability accountable accountably 127 accountancy accountant accountants accounted accounting 128 accounts Accra accredit accreditation accreditations 129 accredited accretion accretions accrue accrued accrues 130 accruing acculturate acculturated acculturates acculturating 131 acculturation accumulate accumulated accumulates accumulating 132 accumulation accumulations accumulator accumulators 133 accuracies accuracy accurate accurately accurateness accursed 134 accusal accusation accusations accusative accuse accused 135 accuser accuses accusing accusingly accustom accustomed 136 accustoming accustoms ace aces acetate acetone acetylene 137 Achaean Achaeans ache ached aches achievable achieve achieved 138 achievement achievements achiever achievers achieves achieving 139 Achilles aching acid acidic acidities acidity acidly acids 140 acidulous Ackerman Ackley acknowledge acknowledgeable 141 acknowledged acknowledgement acknowledgements acknowledger 142 acknowledgers acknowledges acknowledging acknowledgment 143 acknowledgments acme acne acolyte acolytes acorn acorns 144 acoustic acoustical acoustically acoustician acoustics 145 acquaint acquaintance acquaintances acquainted acquainting 146 acquaints acquiesce acquiesced acquiescence acquiescent 147 acquiesces acquiescing acquirable acquire acquired acquires 148 acquiring acquisition acquisitions 149} 150 151for { set i 0 } { $i < 500 } { incr i } { 152 .tnb insert end -text [lindex $tabLabels $i] -state normal 153} 154 155scrollbar .s -command { .tnb view } -orient horizontal 156radiobutton .left -text "Left" -variable side -value "left" \ 157 -command { .tnb configure -side $side -rotate 90 } 158radiobutton .right -text "Right" -variable side -value "right" \ 159 -command { .tnb configure -side $side -rotate 270 } 160radiobutton .top -text "Top" -variable side -value "top" \ 161 -command { .tnb configure -side $side -rotate 0 } 162radiobutton .bottom -text "Bottom" -variable side -value "bottom" \ 163 -command { .tnb configure -side $side -rotate 0 } 164 165table . \ 166 .tnb 0,0 -fill both -cspan 2 \ 167 .s 1,0 -fill x -cspan 2 \ 168 .top 2,0 -cspan 2 \ 169 .left 3,0 \ 170 .right 3,1 \ 171 .bottom 4,0 -cspan 2 172 173table configure . r1 r3 r4 r2 -resize none 174focus .tnb 175 176.tnb focus 0 177 178set filecount 0 179foreach file { graph1 graph2 graph3 graph5 barchart2 } { 180 namespace eval $file { 181 if { [string match graph* $file] } { 182 set graph [graph .tnb.$file] 183 } else { 184 set graph [barchart .tnb.$file] 185 } 186 source scripts/$file.tcl 187 .tnb tab configure $filecount -window $graph -fill both 188 incr filecount 189 } 190} 191 192.top invoke 193 194