#!/usr/bin/wish # -*- tcl -*- V3.3, 12/03 by sven package require Tk wm title . "Ionization loss" option add *activeBackground "#FFFFFF" option add *selectBackground "#00ddbb" set tDe 0 set eUnit MeV/n set tId Hydrogen set wrfile 0 array set g {name1 "Hydrogen Helium Lithium Beryllium Boron \ \"Carbon, Amorphous\" \"Carbon, Graphite\" Nitrogen Oxygen \ Fluorine Neon Sodium Magnesium Aluminum\ Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium\ Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc\ Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium\ Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium\ Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon\ Cesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium\ Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium\ Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium\ Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon\ Francium Radium Actinium Thorium Protactinium Uranium Neptunium\ Plutonium Americium Curium Berkelium Californium" zoa1 "0.992162 0.499675 0.432214 0.443844 0.462535 0.499542 0.499542 0.499761\ 0.500019 0.473724 0.495565 0.478474 0.493726 0.481811 0.498478 0.484281\ 0.499064 0.479508 0.450586 0.485955 0.499002 0.467124 0.459482 0.451498\ 0.461574 0.455058 0.465558 0.458146 0.477083 0.456362 0.458856 0.444636\ 0.440832 0.440460 0.430598 0.438026 0.429594 0.432912 0.433691 0.438666\ 0.438500 0.441304 0.437774 0.439192 0.435342 0.437294 0.432250 0.435718\ 0.427008 0.426755 0.421265 0.418891 0.407524 0.417637 0.411303 0.413828\ 0.407777 0.410351 0.413931 0.418714 0.415973 0.420942 0.412344 0.414583\ 0.406995 0.408997 0.406154 0.406232 0.406553 0.408443 0.404531 0.405791\ 0.403384 0.403431 0.402502 0.402778 0.399579 0.400583 0.399836 0.401083\ 0.398823 0.396315 0.395753 0.397166 0.401948 0.404787 0.387356 0.390100\ 0.389337 0.392022 0.387867 0.393878 0.386508 0.392325 0.393220 0.390848\ 0.388554 0.392601 0.390314" zoa2 "0.549031 0.550966 0.537680 0.518027 \ 0.558468 0.499190 0.538758 0.490382 0.551776 0.587185 0.536895 0.527400 \ 0.527397 0.527919 0.422069 0.445611 0.537680 0.479778 0.420652 0.549952\ 0.530103 0.521299 0.470580 0.488378 0.554227 0.584966 0.566630\ 0.499687 0.416649 0.427472 0.499554 0.486700 0.499292 0.499495\ 0.437610 0.499889 0.481072 0.530399 0.532794 0.514237 0.552785\ 0.421319 0.415689 0.515288 0.485852 0.502736 0.570337 0.503389\ 0.517437 0.505257 0.566630 0.547238 0.537574 0.598615 0.564373\ 0.544046 0.570337 0.548767 0.475916 0.465067 0.473232 0.553282\ 0.479681 0.448012 0.478656 0.456651 0.438975 0.422656 0.442473\ 0.539734 0.497068 0.421007 0.497313 0.534888 0.533714 0.542921\ 0.516121 0.511128 0.578823 0.580204 0.512644 0.425878 0.427063\ 0.403227 0.522568 0.487203 0.462617 0.503214 0.418393 0.468519\ 0.484869 0.549652" zoa3 "0.555116 0.498137 0.481527 0.496224\ 0.490139 0.409332 0.623340 0.561763 0.564789 0.538856 0.549378\ 0.550051 0.548281 0.550136 0.530532 0.519856 0.499855 0.550625\ 0.547902 0.552359 0.556486 0.577781 0.572748 0.582122 0.454532\ 0.541415 0.405828 0.527671 0.526968 0.525176 0.570337 0.520370\ 0.539369 0.532868 0.570337 0.537680 0.479925 0.480810 0.534323\ 0.544798 0.545366 0.512011 0.495132 0.499730 0.539844 0.433728\ 0.488343 0.589620 0.589620 0.565765 0.530965 0.570337 0.557854\ 0.519560 0.499298 0.436700 0.446550 0.436633 0.425944 0.549325\ 0.490618 0.426968 0.484035 0.494149 0.532597 0.531699 0.521485\ 0.551083 0.482410 0.408613 0.551210 0.549750 0.549927 0.550268\ 0.475721 0.542651 0.487104 0.538001 0.429760 0.396869 0.391937\ 0.399959 0.532841 0.546320 0.485850 0.555087 0.555087 0.546309"\ i2 "65.1 64.2 58.2 71.4 63.2 85.7 71.9 145.2 63.2 \ 53.7 66.2 69.5 85.9 72.4 375.9 285.7 63.4 93.2 534.1 75.2 91.9 106.4\ 84.7 99.6 73.3 48.3 59.9 86.8 539.3 468.3 136.4 166.0 176.1\ 152.3 395.0 85.0 166.3 77.6 74.6 87.0 76.7 440.7 553.1 89.1\ 156.0 135.2 56.4 106.5 103.3 111.9 60.0 66.6 98.6 45.4 62.9\ 69.3 50.7 73.3 227.3 261.0 248.6 76.4 143.0 284.9 126.6\ 210.5 293.5 493.3 384.9 74.8 134.0 526.4 145.4 77.2 73.3\ 72.6 75.0 129.7 54.4 54.0 79.6 439.7 421.2 766.7 55.5 87.9\ 94.0 36.5 485.1 73.6 94.6 75.3" \ i3 "67.9 118.0 134.3 143.8 108.3 684.5 41.7 67.6 60.9 75.1\ 75.3 74.7 74.3 74.2 68.4 75.8 84.9 64.3 63.9 63.2 61.6 54.7\ 55.9 53.6 331.0 64.7 746.5 69.6 73.1 81.7 57.4 78.7 74.0\ 77.4 56.5 68.7 99.1 120.7 73.7 69.7 67.2 108.2 134.3 88.8\ 67.7 431.9 189.9 47.1 52.0 61.1 66.2 56.5 59.8 93.0 139.2\ 486.6 398.4 487.1 543.5 72.7 125.0 452.0 148.8 114.6 67.7\ 77.5 71.7 75.0 159.2 690.3 72.3 74.9 61.2 59.5 179.5 62.5\ 148.1 81.2 354.4 752.0 862.0 720.6 72.8 67.7 98.6 75.0 71.6\ 61.8" i1 "19.2 41.8 40.0 63.7 76.0 81.0 78.0 82.0 95.0 115.0 137.0 149.0\ 156.0 166.0 173.0 173.0 180.0 174.0 188.0 190.0 191.0 216.0 233.0 245.0\ 257.0 272.0 286.0 297.0 311.0 322.0 330.0 334.0 350.0 347.0 348.0\ 343.0 352.0 363.0 366.0 379.0 393.0 417.0 424.0 428.0 441.0 449.0\ 470.0 470.0 469.0 488.0 488.0 487.0 485.0 491.0 482.0 488.0 491.0\ 501.0 523.0 535.0 546.0 560.0 574.0 580.0 591.0 614.0 628.0 650.0\ 658.0 674.0 684.0 694.0 705.0 718.0 727.0 736.0 746.0 757.0 790.0\ 790.0 800.0 810.0 823.0 823.0 830.0 825.0 794.0 827.0 826.0 841.0\ 847.0 878.0 890.0 902.0 921.0 934.0 939.0 952.0 966.0" chunk 1} set g(name2) {"A-150 Tissue-Equivalent Plastic" "Acetone" "Acetylene"\ "Adenine" "Adipose Tissue (Icrp)" "Air, Dry (Near Sea Level)" "Alanine"\ "Aluminum Oxide" "Amber" "Ammonia" "Aniline" "Anthracene" "B-100\ Bone-Equivalent Plastic" "Bakelite" "Barium Fluoride" "Barium Sulfate"\ "Benzene" "Beryllium Oxide" "Bismuth Germanium Oxide" "Blood (Icrp)"\ "Bone, Compact (Icru)" "Bone, Cortical (Icrp)" "Boron Carbide" "Boron\ Oxide" "Brain (Icrp)" "Butane" "N-Butyl Alcohol" "C-552 Air-Equivalent\ Plastic" "Cadmium Telluride" "Cadmium Tungstate" "Calcium Carbonate"\ "Calcium Fluoride" "Calcium Oxide" "Calcium Sulfate" "Calcium\ Tungstate" "Carbon Dioxide" "Carbon Tetrachloride" "Cellulose Acetate,\ Cellophane" "Cellulose Acetate Butyrate" "Cellulose Nitrate" "Ceric\ Sulfate (Dosimeter Solution)" "Cesium Fluoride" "Cesium Iodide"\ "Chlorobenzene" "Chloroform" "Concrete, Portland" "Cyclohexane"\ "1,2-Dichlorobenzene" "Dichlorodiethyl Ether" "1,2-Dichloroethane"\ "Diethyl Ether" "N,N-Dimethyl Formamide" "Dimethyl Sulfoxide" "Ethane"\ "Ethyl Alcohol" "Ethyl Cellulose" "Ethylene" "Eye Lens (Icrp)" "Ferric\ Oxide" "Ferroboride" "Ferrous Oxide" "Ferrous Sulfate (Dosimeter\ Solution)" "Freon-12" "Freon-12b2" "Freon-13" "Freon-13b1" "Freon-13i1"\ "Gadolinium Oxysulfide" "Gallium Arsenide" "Gel In Photographic\ Emulsion" "Pyrex Glass" "Glass, Lead" "Glass, Plate" "Glucose"\ "Glutamine" "Glycerol" "Guanine" "Gypsum, Plaster Of Paris"\ "N-Heptane" "N-Hexane" "Kapton Polyimide Film" "Lanthanum Oxybromide"\ "Lanthanum Oxysulfide" "Lead Oxide" "Lithium Amide" "Lithium\ Carbonate" "Lithium Fluoride" "Lithium Hydride" "Lithium Iodide"\ "Lithium Oxide" "Lithium Tetraborate" "Lung (Icrp)"} set g(name3) {"M3 Wax" "Magnesium Carbonate" "Magnesium Fluoride"\ "Magnesium Oxide" "Magnesium Tetraborate" "Mercuric Iodide" "Methane"\ "Methanol" "Mix D Wax" "Ms20 Tissue Substitute" "Muscle, Skeletal\ (Icrp)" "Muscle, Striated (Icru)" "Muscle-Equivalent Liquid (With\ Sucrose)" "Muscle-Equivalent Liquid (Without Sucrose)" "Napthalene"\ "Nitrobenzene" "Nitrous Oxide" "Nylon (Du Pont Elvamide 8062)" "Nylon \ (Type 6 And Type 6/6)" "Nylon (Type 6/10)" "Nylon (Type 11, Rilsan)"\ "Octane, Liquid" "Paraffin Wax" "N-Pentane" "Photographic Emulsion"\ "Plastic Scintillator (Vinyltoluene Based)" "Plutonium Dioxide"\ "Polyacrylonitrile" "Polycarbonate (Makrolon, Lexan)"\ "Polychlorostyrene" "Polyethylene" "Polyethylene Terephthalate\ (Mylar)" "Polymethyl Methacralate (Lucite, Perspex, Plexiglass)"\ "Polyoxymethylene" "Polypropylene" "Polystyrene"\ "Polytetrafluoroethylene (Teflon)" "Polytrifluorochloroethylene"\ "Polyvinyl Acetate" "Polyvinyl Alcohol" "Polyvinyl Butyral" "Polyvinyl\ Chloride" "Polyvinylidene Chloride (Saran)" "Polyvinylidene Fluoride"\ "Polyvinyl Pyrrolidone" "Potassium Iodide" "Potassium Oxide" "Propane"\ "Propane, Liquid" "N-Propyl Alcohol" "Pyridine" "Rubber, Butyl"\ "Rubber, Natural" "Rubber, Neoprene" "Silicon Dioxide" "Silver\ Bromide" "Silver Chloride" "Silver Halides In Photographic Emulsion"\ "Silver Iodide" "Skin (Icrp)" "Sodium Carbonate" "Sodium Iodide"\ "Sodium Monoxide" "Sodium Nitrate" "Stilbene" "Sucrose" "Terphenyl"\ "Testes (Icrp)" "Tetrachloroethylene" "Thallium Chloride" "Tissue,\ Soft (Icrp)" "Tissue, Soft (Icru Four-Component)" "Tissue-Equivalent\ Gas (Methane Based)" "Tissue-Equivalent Gas (Propane Based)" "Titanium\ Dioxide" "Toluene" "Trichloroethylene" "Triethyl Phosphate" "Tungsten\ Hexafluoride" "Uranium Dicarbide" "Uranium Monocarbide" "Uranium\ Oxide" "Urea" "Valine" "Viton Fluoroelastomer" "Water, Liquid" "Water\ Vapor" "Xylene"} set lv $g(name1) proc change {} { global g lv cSi set index [.ms.csel.menu index $cSi] set g(chunk) [incr index] set lv $g(name$index) } proc mkms {} { global g lv cSi toplevel .ms pack [frame .ms.btns] -fill x -side bottom button .ms.btns.e -text " Dismiss " -command "destroy .ms" -activeb \#fff pack .ms.btns.e -fill x -expand 1 tk_optionMenu .ms.csel cSi "Elements" "Composites A-L" "Composites M-Z" pack .ms.csel -fill x for {set i 0} {$i < 3} {incr i} { .ms.csel.menu entryconfigure $i -command change -indicatoron no } pack [frame .ms.lbf] -fill y -expand 1 # set lv $g(name1) pack [scrollbar .ms.lbf.s -command {.ms.lbf.l yview} ] -side right -fill y listbox .ms.lbf.l -listvar lv -width 50 -height 25 \ -yscrollcommand {.ms.lbf.s set} bind .ms.lbf.l <> transfer pack .ms.lbf.l -side top -fill y -expand 1 set geo [wm geometry .] wm geometry .ms [string range $geo [string first + $geo] end] wm title .ms "Please Select" wm resizable .ms 0 1 } proc pdef { y } { if {![string is double -strict [set st [$y get]]]} then { return -1 } else { if {$st > 0} {return $st} {return -1} } } proc getData { } { if {[set x [pdef .target.ind.zoa.t]] > 0 && \ [set z [pdef .target.ind.i.t]] > 0} { return [list $x $z] } else { return -1 } } proc showTarget { } { global g tId lv set n [lsearch $lv $tId] .target.ind.zoa.t delete 0 end .target.ind.zoa.t insert 0 [format "%8.6f" [lindex $g(zoa$g(chunk)) $n]] .target.ind.i.t delete 0 end .target.ind.i.t insert 0 [format "%5.1f" [lindex $g(i$g(chunk)) $n]] doMath } proc transfer { } { global g tId set l [set tId [lindex $g(name$g(chunk)) [.ms.lbf.l curselection]]] if {[set br [string first ( $l]] >= 0} then { set l [string range $l 0 [incr br -2]] } .target.id configure -text $l showTarget destroy .ms } proc totalDe { } { # Toggle inputs for total energy loss global tDe if {$tDe == 0} then { set tDe 1 grid .pa .tt .o2 -row 1 -sticky ewns -pady 3 -padx 3 after idle doMath } else { set tDe 0 grid forget .pa .tt .o2 } } proc getdEdx {z2 pE x} { # Expect: z2 = Z_projectile^2, pE = projectile-energy, x = target properties # x[0]=Z/A, x[1]=I # A couple constants (everything is in MKS): set c2 8.98755178737e16 ;# c^2 set e 1.6021773349e-19 ;# everything in MKS units set e024p 9.85161257021e-22 ;# 4 * pi * epsilon_0^2 set N_0 6.023e23 # particle masses set mp 0.9382723128 ;# in GeV !! set me 9.109389754e-31 ;# kg # electrons per kg/cubic meter set N_e [expr $N_0 * 1000 * [lindex $x 0]] # projectile properties set gamma [expr ($pE / 1000.) / $mp + 1] set g2 [expr $gamma*$gamma] set b2 [expr 1 - 1 / $g2 ] ;# beta^2 set v2 [expr $b2 * $c2] ;# v^2 set frnt [expr ( $z2 * pow($e,4) * $N_e ) / \ ( $e024p * $me * $v2) ] set lnt [expr log( 2 * $g2 * $me * $v2 / \ ([lindex $x 1] * $e) ) ] set dedx [expr $frnt * ($lnt - $b2)] ;# in MKS units # convert: [J -> eV] [-> MeV] [kg/m^2 -> g/cm^2] set dedx [expr $dedx / $e / 1e6 * 10] return $dedx } proc about {} { tk_dialog .err "About bbt" \ "Just another one of these little TCL/Tk hacks by Sven Geier Originally written in IDL (RSI) in the early nineties when I learned programming under X, later ported to TCL/Tk to get out of proprietary software. The materials data (in particular the adjusted ionization potentials) was cobbled together from a lot of places, most notably the NIST STaR database. Big tip'o'the hat to those folks. As of 2003, I can be reached for comments, complaints, praise, suggestions or cookies at sgeier@caltech.edu " "" 0 "I see..." } proc hlp {} { if {[winfo exists .help]} then { wm deiconify .help raise .help } else { toplevel .help # could read this text from a file or something... pack [label .help.l -justify left -text \ "The 'Total dE' computation propagates the projectile through thin slices of the target, computing the energy loss in each slice. Thus it will tend to yield more total energy loss than multiplying stopping power with grammage by a factor that depends on the fractional energy loss and the charge of the projectile (since a low-Z projectile will lose the same amount of energy in more frequent smaller packets than high-Z ones). The distance travelled in the 'total dE' calculation is the projected distance along the original path, i.e. no scattering corrections are taken into account. At 800keV/n the path of an alpha projectile in matter will be about 10% or so longer than this projected distance. The 'File' button simply writes the current results to a file with the name 'bbt.out'. If the file already exists, the results will be appended." -border 2 -relief groove] \ -padx 8 -pady 8 -ipadx 5 -ipady 5 -expand 1 button .help.a -text "About" -command "about" -activeb white pack .help.a -side left -padx 8 -pady 8 pack [frame .help.f] -side left -padx 8 -pady 8 -expand 1 button .help.f.b -text "Dismiss" -command "destroy .help" -activeb white pack .help.f.b -side bottom -pady 8 } bind .help "destroy .help" bind .help "destroy .help" wm transient .help wm geometry .help +300+150 wm resizable .help 0 0 } proc uch {a b c} {doMath} proc doMath { } { global eUnit tDe wrfile set x [getData] # x now contains Z, A, I of target set pZ [pdef .proj.z.input] set p0 [pdef .proj.e.input] if {[lindex $x 0] > 0 && [lindex $x 1] > 0 && $pZ > 0 && $p0 > 0} then { set j [expr [.proj.e.unit.menu index $eUnit] - 1 ] set pE [expr $p0 * pow(10,[expr 3 * $j])] # pZ, pE contain charge and energy (in Mev/n) of the projectile set z2 [expr $pZ * $pZ] set dedx [getdEdx $z2 $pE $x] .output.t0.res configure -text [format "%.3f" \ [set spo [expr $dedx / $z2]]] .output.t1.res configure -text [format "%.3f" $dedx] if {$wrfile == 1} then { set lud [open "bbt.out" a] puts $lud [format " Projectile: Z=%.1f, E=%.3f %s Target: Z/A=%.6f, I=%.3f -> Stopping power = %.3f z^2 MeV cm^2/g -> dE / dx = %.3f MeV cm^2/g" \ $pZ $p0 $eUnit [lindex $x 0] [lindex $x 1] $spo $dedx] } set pA [pdef .pa.a.input] set tt [pdef .tt.t] if { $tDe == 1 && $pA > 0 && $tt > 0 } then { if {$wrfile == 1} {puts $lud [format \ " Projectile: A=%.2f amu Target: t=%.4f g/cm^2" $pA $tt] } set steps 250 set tstep [expr 1. * $tt / $steps] set txde $pE for {set i 0} {$i < $steps} {incr i} { set dedx [getdEdx $z2 $pE $x] set pE [expr $pE - ($tstep * $dedx)/$pA] if {$pE < 0} then { set i $steps } } if {$pE < 0} then { set o2r "Stopped!" if {$wrfile == 1} {puts $lud "-> [set o2r Stopped!]"} } else { set txde [expr $txde - $pE] set o2r "[format %.3f $txde] MeV/n" if {$wrfile == 1} {puts $lud "-> Total energy loss = $o2r"} } .o2.res configure -text $o2r -fg black } else { .o2.res configure -text "??" -fg red } if {$wrfile == 1} {puts $lud "" ; close $lud} } else { # puts "==> $x $pZ $p0 " } } proc tstnum {x w} { if {$x == "." || [string is space $x]} { return 1 } if {[string is double $x]} then { if {[string compare $x [set y [string trimleft [string trim $x] 0]]]} { $w delete 0 end $w insert 0 $y after idle "$w configure -validate key" } after cancel doMath after idle doMath return 1 } else { return 0 } } proc wrf {} { global wrfile set wrfile 1 doMath set wrfile 0 } proc AllDone { } { exit } frame .proj -relief groove -bd 2 frame .target -relief groove -bd 2 frame .output -bd 2 -relief groove grid .proj .target .output -row 0 -pady 3 -padx 3 -sticky nsew frame .pa -bd 2 -relief groove frame .tt -bd 2 -relief groove frame .o2 -bd 2 -relief groove frame .buttons -bd 2 -relief groove grid .buttons -pady 3 -padx 3 -columnspan 3 -row 2 -sticky ew pack [frame .output.l0] -fill x pack [label .output.l0.t -text "Stopping Power:"] -side left -pady 3 -padx 3 pack [frame .output.t0] -side top -pady 3 -padx 3 pack [label .output.t0.res] -side left pack [label .output.t0.unit -text "z² MeV cm²/g"] -side left pack [frame .output.l1] -fill x pack [label .output.l1.t -text "Energy Deposit:"] -side left -pady 3 -padx 3 pack [frame .output.t1] -side top -pady 3 -padx 3 pack [label .output.t1.res] -side left pack [label .output.t1.unit -text "MeV cm²/g"] -side left pack [label .o2.t -text "Total dE:"] -side left pack [label .o2.res] -side left label .proj.title -text "Projectile" -fg red -pady 3 -padx 3 pack .proj.title -side top -expand 1 pack [frame .proj.z] -side top -pady 3 -padx 3 -expand 1 label .proj.z.title -text "Charge \[e\]: "; entry .proj.z.input -width 3 -validate key -vcmd {tstnum %P %W} -invcmd bell pack .proj.z.title .proj.z.input -side left -fill y ; .proj.z.input insert 0 1 pack [frame .proj.e] -side top -pady 3 -padx 3 -fill y -expand 1 label .proj.e.title -text "Energy:" ; entry .proj.e.input -width 4 -validate key -vcmd {tstnum %P %W} -invcmd bell pack .proj.e.title .proj.e.input -side left -padx 3 .proj.e.input insert 0 100 tk_optionMenu .proj.e.unit eUnit "keV/n" "MeV/n" "GeV/n" "TeV/n" trace va eUnit w uch .proj.e.unit configure -borderwidth 1 pack .proj.e.unit -side left frame .pa.a -bd 2 ; pack .pa.a -side top label .pa.a.title -text " Mass \[amu\]: "; pack .pa.a.title -side left entry .pa.a.input -width 3 -validate key -vcmd {tstnum %P %W} -invcmd bell pack .pa.a.input -side left -padx 3 -ipadx 3; .pa.a.input insert 0 1 label .target.title -text "Target" -foreground red pack .target.title -side top -expand 1 button .target.id -text $tId -command mkms -activeb \#fff pack .target.id -side top -fill x -expand 1 frame .target.ind frame .target.ind.zoa pack [label .target.ind.zoa.l -text "Z/A"] pack [entry .target.ind.zoa.t -width 8 -validate key -vcmd {tstnum %P %W} -invcmd bell] frame .target.ind.i pack [label .target.ind.i.l -text "I"] pack [entry .target.ind.i.t -width 5 -validate key -vcmd {tstnum %P %W} -invcmd bell] pack .target.ind.zoa .target.ind.i -side left -padx 5 pack .target.ind -pady 3 pack [label .tt.l1 -text " Thickness:" ] -side left pack [entry .tt.t -width 5 -validate key -vcmd {tstnum %P %W} -invcmd bell] -side left .tt.t insert 0 1.0 pack [label .tt.l2 -text "g/cm²"] bind . doMath wm resizable . 0 0 wm geometry . "+300+300" showTarget pack [button .buttons.hlp -text " Help " -command hlp -bd 2 -bg \#55b -activeb \#6af -fg white ] -side left -padx 3 button .buttons.tde -bg \#4b4 -activeb \#0f0 -text "Total dE" -command totalDe pack .buttons.tde -side left -pady 3 -padx 3 -ipadx 10 button .buttons.twf -bg \#b44 -activeb \#f66 -text "File" -command wrf pack .buttons.twf -side left -pady 3 -padx 3 -ipadx 10 button .buttons.ebut -bg \#bb4 -activeb \#ff0 -text "Exit" -command AllDone pack .buttons.ebut -side right -pady 3 -padx 3 -ipadx 10