#!/usr/bin/wish -f ## ##+####################################################################### ## NOTE: ## If the 'wish' interpreter is in another directory, like ## /usr/local/bin, you, as root, can make a soft-link from 'wish' there ## to /usr/bin/wish --- with a command like ## ln -s /usr/bin/local/wish /usr/bin/wish ## The form of this command: ## ln -s ##+####################################################################### ## Tk SCRIPT NAME: tkAtomAndPropertySelector_viaList.tk ## ## WHERE: in $FEDIR_TKGUIS/SELECTORtools = $FEDIR/tkGUIs/SELECTORtools ## ## where $FEDIR is the installation directory ## of an FE subsystem --- such as 'tkGooies'. ## Reference: www.freedomenv.com ##+####################################################################### ## PURPOSE: This Tk GUI script provides a GUI for SELECTING AN ATOM ## and showing a list of many of its properties in a text-area ## on the GUI. ## ## In addition, the user can SELECT an atomic property type ## --- such as atomic weight or density or melting point or ## boiling point or whatever. Then, by clicking on a 'UseIt' ## button on the GUI, 'results' are written to 'stdout'. ## ## The 'results' include 5 items --- 3 atom IDs (number, ## symbol, and name) and a property-type-name and its value ## for the selected atom. ## ## The GUI provides 2 listboxes: ## - one to select an atom from a list of about 100 ## and ## - one to select an atomic property from a list of ## about 10 to 20. ## ## The atom list shows 3 identifying items: ## - atomic number (such as 1) ## - atomic symbol (such as 'H') ## - atomic name (such as 'Hydrogen'). ## ##+######### ## OPERATION: ## ## After the user has chosen an atom and a property, the ## user can click on a 'UseIt' button, and 'the results' ## are sent, as a string, to 'stdout'. ## ## With this 'selection' capability, this Tk script can be called ## IN A SHELL SCRIPT OR IN ANOTHER TK SCRIPT, so that this Tk script ## can ACT AS AN ATOM (and property) SELECTOR utility. ## ##+####################################### ## REFERENCES - Sources of properties data: ## ## * macro-properties data: https://en.wikipedia.org/wiki/List_of_elements ## micro-properties data: https://en.wikipedia.org/wiki/List_of_elements_by_atomic_properties ## ## discoverers: https://en.wikipedia.org/wiki/Timeline_of_chemical_element_discoveries ## periodic tables: https://en.wikipedia.org/wiki/Alternative_periodic_tables ## periodic tables groups: https://en.wikipedia.org/wiki/Category:Groups_in_the_periodic_table ## ##+################# ## THE GUI WIDGETS: ## ## The options available to the user are indicated by ## the following 'sketch' of the GUI: ## ## FRAMEnames ## VVVVVVVVVV ## ----------------------------------------------------------------------------------- ## tk Atom (and property) Selector ## [window title] ## ----------------------------------------------------------------------------------- ## ## .fRbuttons {UseIt} {Cancel} {Help} Selected Atom: ...... Selected Property Type: ........ ## ## .fRmsg [.... Messages to user are display in a label here ...............................] ## ## .fRleft [contains a text area] .fRright [2 listboxes are in this frame] ## PROPERTY VALUES: ATOM IDs: ## |---------------------------------------A |-----------------------------------A ## .fRleft.text | TEXT widget to hold lines of | | LISTBOX to hold IDs of ATOMS, | ## | property names and values, such as | | SUCH AS: | ## | Atomic IDs: ... | | 1 ; H ; Hydrogen | ## | Atomic weight: ... | | 2 ; He ; Helium | ## | Density: ... | | ... | ## | Melting Point: ... | | ... | ## | Boiling Point: ... | |<--------------------------------->V ## | ... | PROPERTY TYPES: ## | ... | |-----------------------------------A ## | | | LISTBOX to hold names of atomic | ## | | | PROPERTIES, such as: | ## | | | atomic weight | ## | | | density | ## | | | melting point | ## | | | boiling point | ## | | | ... | ## |<------------------------------------->V |<--------------------------------->V ## ## ------------------------------------------------------------------- ## ## In the above sketch of the GUI: ## ## SQUARE BRACKETS indicate a comment (not to be placed on the GUI). ## BRACES indicate a Tk 'button' widget. ## A COLON indicates that the text before the colon is on a 'label' widget. ## (To clarify the label extent, single quotes may be used around the text.) ## UNDERSCORES indicate a Tk 'entry' widget. ## CAPITAL-O indicates a Tk 'radiobutton' widget. ## CAPITAL-X indicates a Tk 'checkbutton' widget (if any). ## <----O----> indicates a Tk 'scale' widget (if any). ## ## A rectangle marked ## by hyphens (-) and ## vertical bars (|) indicates a Tk 'listbox' widget. ## ##+############## ## GUI components: ## ## From the GUI 'sketch' above, it is seen that the GUI consists of ## about ## ## - 3 button widgets ## - 8 label widgets (a couple may be one-line text widgets) ## - 1 text widget (with x,y scrollbars) ## - 2 listbox widgets (with x,y scrollbars) ## - 0 entry widgets ## - 0 radiobutton widgets ## - 0 checkbutton widgets ## - 0 scale widgets ## - 0 canvas widgets ## ##+##################################################################### ## CALLED BY: a 'SELECTORtools' toolchest in the 'tkGooies' FE system ## OR ## in a shell script or another Tk script. ##+##################################################################### ## OUTPUT: to 'stdout' is a string of values with a separator ## (such as a semicolor). The first 3 values (atom IDs) ## are positional --- that is, there is no name indicating ## what kind of value they are. The last 2 values are a ## property-name and a property-value. ## Example: ## ## {atom-number} ; {atom-symbol} ; {atom-name} ; {property-name} ; {property-value} ## ## The braces contain a name for each value. ## ##+##################################################################### ## CALL FORMAT: ## ## .../tkAtomAndPropertySelector_viaList.tk [atom-number] [property-name] ## ## An atom-number can be passed as an argument to determine a starting ## atom to be pre-selected in the atom-IDs listbox. ## An atom property-name can ALSO be passed as an argument to determine ## a starting property to be pre-selected in the property-types listbox. ## ## Example call format within a script (shell or Tcl-Tk): ## ## TEMP=`$FEDIR_TKGUIS/tkAtomAndPropertySelector_viaList.tk [atom-number] [property-name]` ## ## (Note: The values in TEMP can be extracted with a shell command like ## 'cut' or 'awk' -- or a Tcl command like 'split'.) ##+######################################################################## ## 'CANONICAL' STRUCTURE OF THIS CODE: ## ## 0) Set general window parms (win-name, win-position, win-color-scheme, ## fonts, widget-geom-parms, win-size-control, text-array-for-labels-etc). ## 1a) Define ALL frames (and sub-frames). ## 1b) Pack ALL the frames and sub-frames. ## 2) Define & pack all widgets in the frames, frame by frame. ## ## 3) Define key and mouse/touchpad/touch-sensitive-screen 'event' ## BINDINGS, if needed. ## 4) Define PROCS, if needed. ## 5) Additional GUI INITIALIZATION (typically with one or two ## procs in section 4), if needed. ## ##+################################# ## The code structure in more detail, for this particular script: ## ## 1a) Define ALL frames: ## Top-level : '.fRbuttons' , .fRmsg', '.fRleft' , '.fRright' ## ## Sub-frames: '.fRright.fRatomIDs' ## '.fRright.fRatomPROPS' ## ## '.fRbuttons' and '.fRmsg' are to be on the top of the GUI, and ## '.fRleft' , '.fRright' are to be under '.fRmsg' ## on the left and right, respectively. ## ## 1b) Pack ALL frames. ## ## 2) Define & pack all widgets in the frames -- basically going through ## frames & their interiors in top-to-bottom and/or left-to-right order: ## ## - '.fRbuttons' (to contain several buttons --- also could contain ## label and/or text widgets in which to display a ## user-selected atom-ID and a user-selected ## atom-property-type.) ## ## - '.fRmsg' (to contain a 'label' widget) ## ## - '.fRleft' (to contain a 'text' widget with 2 scrollbars) ## ## - '.fRright.fRatomIDs' (to contain a 'listbox' with 2 scrollbars) ## - '.fRright.fRatomPROPS' (to contain a 'listbox' with 2 scrollbars) ## ## 3) Define BINDINGS: none currently ## ## 4) Define PROCS: ## - 'listbox_select_atomID' - called by a button1-release binding on ## the atomIDs listbox widget. ## - 'listbox_select_atomPROP' - called by a button1-release binding on ## the atomPROPS listbox widget. ## - 'atom_props_list_update' - called by button1-release bindings on ## the atomIDs and atomPROPS listboxes. ## - 'put_vars' - called by the 'UseIt' button ## - 'advise_user' - called at bottom of script ## - 'popup_msg_var_scroll' - called by the 'Help' button ## ## 5) Additional GUI INITIALIZATION: initialize entry widgets and ## set the HELPtext var for the Help button. ## ##+####################################################################### ## DEVELOPED WITH: Tcl-Tk 8.5 on Ubuntu 9.10 (2009 october, 'Karmic Koala). ## ## wish> puts "$tcl_version $tk_version" ## showed ## 8.5 8.5 ##+######################################################################## ## FE system Copyright 2006+ by Blaise Montandon ##+######################################################################## ## MAINTENANCE HISTORY: ## Created by: Blaise Montandon 2016mar22 Started version for the FE 'tkGooies' ## system, on Linux. ## Changed by: Blaise Montandon 2016 ##+############################################################################ ##+################################# ## SET THE TOP WINDOW NAME. ##+################################# wm title . "tk Atom (and property) Selector" wm iconname . "AtomSelector" # catch { wm title . "$env(ATOM_WIN_TITLE)" } # catch { wm iconname . "$env(ATOM_ICON_TITLE)" } ##+################################### ## SET THE TOP WINDOW POSITION. ##+################################### wm geometry . +50+50 # catch {eval wm geometry . "$env(ATOM_COLORSEL_GEOM)" } ##+####################################################################### ## SET COLOR SCHEME (palette) FOR THE WINDOW. ##+####################################################################### if {1} { ## Grayish palette set Rpal255 210 set Gpal255 210 set Bpal255 210 } if {0} { ## Bluish palette set Rpal255 180 set Gpal255 180 set Bpal255 255 } if {0} { ## Greenish palette set Rpal255 180 set Gpal255 255 set Bpal255 180 } if {0} { ## Reddish palette set Rpal255 255 set Gpal255 180 set Bpal255 180 } set hexCOLORpal [format "#%02X%02X%02X" $Rpal255 $Gpal255 $Bpal255] tk_setPalette $hexCOLORpal ## Set color background for some widgets. set textBKGD "#f0f0f0" set listboxBKGD "#f0f0f0" # set entryBKGD "#f0f0f0" # set radbuttBKGD "#c0c0c0" # set chkbuttBKGD "#c0c0c0" # set scaleBKGD "#f0f0f0" ##+####################################################################### ## SET FONT VARS to use in the 'font create' statements below. ##+####################################################################### set FONTsize 14 set FONT_SMALLsize 12 ## For variable width: set FONT_varwidth \ " -family {comic sans ms} -size -$FONTsize -weight bold -slant roman " set FONT_SMALL_varwidth \ " -family {comic sans ms} -size -$FONT_SMALLsize -weight normal -slant roman " ## For fixed width: set FONT_fixedwidth \ " -family {dejavu sans mono} -size -$FONTsize -weight bold -slant roman " set FONT_SMALL_fixedwidth \ " -family {dejavu sans mono} -size -$FONT_SMALLsize -weight normal -slant roman " ##+##################################################################### ## DEFINE (temporary) 'font create' NAMES to be used ## in '-font' widget specs below. ##+##################################################################### eval font create fontTEMP_button $FONT_varwidth eval font create fontTEMP_label $FONT_varwidth eval font create fontTEMP_text $FONT_fixedwidth eval font create fontTEMP_listbox $FONT_fixedwidth # eval font create fontTEMP_entry $FONT_fixedwidth # eval font create fontTEMP_scale $FONT_varwidth # eval font create fontTEMP_radiobutton $FONT_fixedwidth # eval font create fontTEMP_checkbutton $FONT_fixedwidth # eval font create fontTEMP_SMALL_button $FONT_SMALL_varwidth eval font create fontTEMP_SMALL_label $FONT_SMALL_varwidth # eval font create fontTEMP_SMALL_text $FONT_SMALL_fixedwidth # eval font create fontTEMP_SMALL_listbox $FONT_SMALL_fixedwidth # eval font create fontTEMP_SMALL_entry $FONT_SMALL_fixedwidth # eval font create fontTEMP_SMALL_scale $FONT_SMALL_varwidth # eval font create fontTEMP_SMALL_radiobutton $FONT_SMALL_fixedwidth # eval font create fontTEMP_SMALL_checkbutton $FONT_SMALL_fixedwidth ##+####################################################################### ## SET GEOM VARS FOR THE VARIOUS WIDGET DEFINITIONS. ## (e.g. padx,pady for buttons) ##+####################################################################### ## For BUTTON widgets: set PADY_button 0 set PADX_button 0 set BDwidthPx_button 2 ## For LABEL widgets: set PADXpx_label 0 set PADYpx_label 0 set BDwidthPx_label 2 ## For TEXT widgets: set BDwidthPx_text 2 ## For LISTBOX widgets: set BDwidthPx_listbox 2 set rightListboxWidthChars 15 set rightListboxHeightChars 12 ## For ENTRY widgets: # set BDwidthPx_entry 2 ## SCALE geom parameters: # set BDwidthPx_scale 2 # set scaleLengthPx 300 # set scaleThicknessPx 10 ## CANVAS geom parms: # set initCanWidthPx 200 # set initCanHeightPx 200 # set minCanHeightPx 24 # # set BDwidthPx_canvas 2 # set BDwidthPx_canvas 0 ##+################################################################### ## Set a MINSIZE of the window (roughly). (OR fix the window size.) ## ## For WIDTH, allow for a minwidth of the '.fRbuttons' frame: ## several buttons (UseIt,Cancel,Help), and perhaps ## some label and/or text widgets showing atom info. ## ## For HEIGHT, allow ## 1 char high for the '.fRbuttons' frame ## 1 char high for the '.fRmsg' frame ## min of 5 chars high for the '.fRright.fRatomIDs' frame ## min of 5 chars high for the '.fRright.fRatomPROPS' frame ##+####################################################################### ## If we allow the window to be resizable, we can pack the 2 listboxes ## with '-fill both -expand 1' so that the listboxes can be enlarged by ## enlarging the window. ##+####################################################################### set minWinWidthPx [font measure fontTEMP_varwidth \ " UseIt Cancel Help Selected Atom: ........ Selected Property Type: ......"] ## Add some pixels to account for right-left-side window decoration ## (about 8 pixels), about 7 widgets x 4 pixels/widget for borders/padding ## for buttons and labels. set minWinWidthPx [expr {36 + $minWinWidthPx}] ##+############################################################# ## Set MIN HEIGHT: ## 1 char high for the '.fRbuttons' frame ## 1 char high for the '.fRmsg' frame ## min of 5 chars high for the '.fRright.fRatomIDs' frame ## min of 5 chars high for the '.fRright.fRatomPROPS' frame ##+############################################################# set CharHeightPx [font metrics fontTEMP_varwidth -linespace] set minWinHeightPx [expr {12 * $CharHeightPx}] ## Add about 28 pixels for top-bottom window decoration, ## about 4 frames/widgets x 4 pixels/frame for each of the ## stacked frames/widgets --- their borders/padding. set minWinHeightPx [expr {44 + $minWinHeightPx}] ## FOR TESTING: # puts "minWinWidthPx = $minWinWidthPx" # puts "minWinHeightPx = $minWinHeightPx" wm minsize . $minWinWidthPx $minWinHeightPx ##+############################################# ## If you want to make the window un-resizable, ## you can use the following statement. ##+############################################# # wm resizable . 0 0 ##+######################################################################## ## Set a TEXT-ARRAY to hold text for buttons & labels on the GUI. ## NOTE: This can aid INTERNATIONALIZATION. This array can ## be set according to a nation/region parameter. ##+######################################################################## ## if { "$VARlocale" == "en"} ## For '.fRbuttons' frame: set aRtext(buttonUSEIT) "UseIt" set aRtext(buttonCANCEL) "Cancel" set aRtext(buttonHELP) "Help" set aRtext(labelATOMidSel) " Selected Atom ID:" set aRtext(labelATOMpropSel) " Selected Property Type:" ## For top of '.fRleft' frame (above the text widget): set aRtext(labelPROPS) "PROPERTIES:" ## For top of '.fRright.fRatomIDs' frame (above the listbox widget): set aRtext(labelATOMids) "ATOM IDs:" ## For top of '.fRright.fRatomPROPS' frame (above the listbox widget): set aRtext(labelPROPtypes) "ATOM PROPERTY TYPES:" ## END OF if { "$VARlocale" == "en" ##+#################################################################### ##+#################################################################### ## DEFINE *ALL* THE FRAMES: ## TOP-LEVEL FRAMES: ## '.fRbuttons' - to contain several buttons (UseIt,Cancel,Help), ## as well as some label and text widgets to display ## the current distance, in 2 different units. ## '.fRmsg' - for 1 label widget ## '.fRleft' - for a text-area widget ## '.fRright' - for 2 listbox widgets (with x,y scrollbars) ## ## SUB-FRAMES: ## '.fRright.fRatomIDs' - to contain 1 listbox with scrollbars. ## '.fRright.fRatomPROPS' - to contain 1 listbox with scrollbars. ##+#################################################################### ##+#################################################################### ## FOR TESTING change 0 to 1: ## (Example1: To see appearance of frames when borders are drawn.) ## (Example2: To see sizes of frames for various '-fill' options.) ## (Example3: To see how frames expand as window is resized.) if {0} { set RELIEF_frame raised set BDwidthPx_frame 2 } else { set RELIEF_frame flat set BDwidthPx_frame 0 } frame .fRbuttons -relief $RELIEF_frame -borderwidth $BDwidthPx_frame frame .fRmsg -relief $RELIEF_frame -borderwidth $BDwidthPx_frame frame .fRleft -relief $RELIEF_frame -borderwidth $BDwidthPx_frame frame .fRright -relief $RELIEF_frame -borderwidth $BDwidthPx_frame frame .fRright.fRatomIDs -relief $RELIEF_frame -borderwidth $BDwidthPx_frame # frame .fRright.fRatomIDs -relief raised -borderwidth 2 # frame .fRright.fRatomPROPS -relief $RELIEF_frame -borderwidth $BDwidthPx_frame frame .fRright.fRatomPROPS -relief raised -borderwidth 2 ##+######################################################## ## PACK the TOP-LEVEL FRAMES. ##+######################################################## pack .fRbuttons \ -side top \ -anchor nw \ -fill x \ -expand 0 pack .fRmsg \ -side top \ -anchor nw \ -fill x \ -expand 0 pack .fRleft \ -side left \ -anchor nw \ -fill both \ -expand 1 pack .fRright \ -side left \ -anchor nw \ -fill both \ -expand 1 ##+########################################## ## PACK the 2nd-LEVEL FRAMES. ##+########################################## pack .fRright.fRatomIDs \ -side top \ -anchor nw \ -fill both \ -expand 1 pack .fRright.fRatomPROPS \ -side top \ -anchor nw \ -fill both \ -expand 1 ##+################################################################ ## The frames are defined and packed. ##+################################################################ ## START DEFINING & PACKING WIDGETS WITHIN THEIR FRAMES. ##+################################################################ ##+################################################################ ##+######################################################## ## IN THE '.fRbuttons' frame -- DEFINE several BUTTONS --- ## 1 'UseIt' BUTTON, 1 'Cancel' BUTTON, and 1 'Help' BUTTON. ## Also define a pair of LABEL and TEXT widgets. ## THEN PACK THE WIDGETS. ##+######################################################## button .fRbuttons.buttUSEIT \ -text "$aRtext(buttonUSEIT)" \ -font fontTEMP_button \ -padx $PADX_button \ -pady $PADY_button \ -relief raised \ -bd $BDwidthPx_button \ -command {put_vars} button .fRbuttons.buttCANCEL \ -text "$aRtext(buttonCANCEL)" \ -font fontTEMP_button \ -padx $PADX_button \ -pady $PADY_button \ -relief raised \ -bd $BDwidthPx_button \ -command {exit} button .fRbuttons.buttHELP \ -text "$aRtext(buttonHELP)" \ -font fontTEMP_button \ -padx $PADX_button \ -pady $PADY_button \ -relief raised \ -bd $BDwidthPx_button \ -command {popup_msg_var_scroll "$HELPtext"} label .fRbuttons.labATOMidSel \ -text "$aRtext(labelATOMidSel)" \ -font fontTEMP_SMALL_label \ -justify left \ -anchor w \ -relief flat \ -padx $PADXpx_label \ -pady $PADYpx_label \ -bd $BDwidthPx_label text .fRbuttons.txtATOMidSel \ -relief raised \ -borderwidth $BDwidthPx_text \ -height 1 \ -width 21 \ -wrap none \ -font fontTEMP_text label .fRbuttons.labelATOMpropSel \ -text "$aRtext(labelATOMpropSel)" \ -font fontTEMP_SMALL_label \ -justify left \ -anchor w \ -relief flat \ -padx $PADXpx_label \ -pady $PADYpx_label \ -bd $BDwidthPx_label text .fRbuttons.txtATOMpropSel \ -relief raised \ -borderwidth $BDwidthPx_text \ -height 1 \ -width 14 \ -wrap none \ -font fontTEMP_text ## Pack the widgets in frame '.fRbuttons'. pack .fRbuttons.buttUSEIT \ .fRbuttons.buttCANCEL \ .fRbuttons.buttHELP \ -side left \ -anchor w \ -fill none \ -expand 0 pack .fRbuttons.labATOMidSel \ .fRbuttons.txtATOMidSel \ .fRbuttons.labelATOMpropSel \ .fRbuttons.txtATOMpropSel \ -side left \ -anchor w \ -fill none \ -expand 0 ##+######################################################## ## IN THE '.fRmsg' frame -- ## DEFINE 1 LABEL WIDGET. THEN PACK IT. ##+######################################################## label .fRmsg.labelMSG \ -text "" \ -font fontTEMP_label \ -justify left \ -anchor w \ -relief raised \ -bg "#ffcccc" \ -padx $PADXpx_label \ -pady $PADYpx_label \ -bd $BDwidthPx_label pack .fRmsg.labelMSG \ -side left \ -anchor w \ -fill x \ -expand 1 ##+######################################################## ## IN THE '.fRleft' frame -- ## DEFINE 1 LABEL widget and 1 TEXT widget, with 2 scrollbars. ## THEN PACK THEM. ##+######################################################## label .fRleft.labelPROPS \ -text "$aRtext(labelPROPS)" \ -font fontTEMP_label \ -justify left \ -anchor w \ -relief flat \ -padx $PADXpx_label \ -pady $PADYpx_label \ -bd $BDwidthPx_label text .fRleft.text \ -relief raised \ -borderwidth $BDwidthPx_text \ -height 20 \ -width 20 \ -wrap none \ -font fontTEMP_text \ -yscrollcommand ".fRleft.scrbary set" \ -xscrollcommand ".fRleft.scrbarx set" \ scrollbar .fRleft.scrbary \ -orient vertical -command ".fRleft.text yview" scrollbar .fRleft.scrbarx \ -orient horizontal -command ".fRleft.text xview" ## PACK the widgets in frame '.fRleft'. pack .fRleft.labelPROPS \ -side top \ -anchor nw \ -fill none \ -expand 0 pack .fRleft.scrbary \ -side left \ -anchor w \ -fill y \ -expand 0 pack .fRleft.scrbarx \ -side bottom \ -anchor sw \ -fill x \ -expand 0 pack .fRleft.text \ -side left \ -anchor nw \ -fill both \ -expand 1 ##+###################################################### ## In the '.fRright.fRatomIDs' frame - ## DEFINE 1 LABEL and 1 LISTBOX widget with 2 scrollbars. ## Then PACK them. ##+###################################################### label .fRright.fRatomIDs.labelATOMids \ -text "$aRtext(labelATOMids)" \ -font fontTEMP_label \ -justify left \ -anchor w \ -relief flat \ -padx $PADXpx_label \ -pady $PADYpx_label \ -bd $BDwidthPx_label listbox .fRright.fRatomIDs.listbox \ -width $rightListboxWidthChars \ -height $rightListboxHeightChars \ -font fontTEMP_listbox \ -relief raised \ -borderwidth 2 \ -state normal \ -yscrollcommand ".fRright.fRatomIDs.scrbary set" \ -xscrollcommand ".fRright.fRatomIDs.scrbarx set" scrollbar .fRright.fRatomIDs.scrbary \ -orient vertical -command ".fRright.fRatomIDs.listbox yview" scrollbar .fRright.fRatomIDs.scrbarx \ -orient horizontal -command ".fRright.fRatomIDs.listbox xview" ## Pack the widgets in frame '.fRright.fRatomIDs'. pack .fRright.fRatomIDs.labelATOMids \ -side top \ -anchor w \ -fill none \ -expand 0 pack .fRright.fRatomIDs.scrbary \ -side right \ -anchor e \ -fill y \ -expand 0 pack .fRright.fRatomIDs.scrbarx \ -side bottom \ -anchor sw \ -fill x \ -expand 0 pack .fRright.fRatomIDs.listbox \ -side top \ -anchor nw \ -fill both \ -expand 1 ##+###################################################### ## In the '.fRright.fRatomPROPS' frame - ## DEFINE 1 LABEL and a LISTBOX widget with 2 scrollbars. ## Then PACK them. ##+###################################################### label .fRright.fRatomPROPS.labelPROPtypes \ -text "$aRtext(labelPROPtypes)" \ -font fontTEMP_label \ -justify left \ -anchor w \ -relief flat \ -padx $PADXpx_label \ -pady $PADYpx_label \ -bd $BDwidthPx_label listbox .fRright.fRatomPROPS.listbox \ -width $rightListboxWidthChars \ -height $rightListboxHeightChars \ -font fontTEMP_listbox \ -relief raised \ -borderwidth 2 \ -state normal \ -yscrollcommand ".fRright.fRatomPROPS.scrbary set" \ -xscrollcommand ".fRright.fRatomPROPS.scrbarx set" scrollbar .fRright.fRatomPROPS.scrbary \ -orient vertical -command ".fRright.fRatomPROPS.listbox yview" scrollbar .fRright.fRatomPROPS.scrbarx \ -orient horizontal -command ".fRright.fRatomPROPS.listbox xview" ## Pack the widgets in frame '.fRright.fRatomPROPS'. pack .fRright.fRatomPROPS.labelPROPtypes \ -side top \ -anchor w \ -fill none \ -expand 0 pack .fRright.fRatomPROPS.scrbary \ -side right \ -anchor e \ -fill y \ -expand 0 pack .fRright.fRatomPROPS.scrbarx \ -side bottom \ -anchor sw \ -fill x \ -expand 0 pack .fRright.fRatomPROPS.listbox \ -side top \ -anchor nw \ -fill both \ -expand 1 ##+####################################### ## END OF MAIN SECTION TO SETUP THE GUI. ## FRAMES AND WIDGETS ARE DEFINED. ##+####################################### ##+##################################################################### ##+##################################################################### ## BINDINGS section: bindings on the 2 listbox widgets. ##+##################################################################### ##+##################################################################### bind .fRright.fRatomIDs.listbox \ {listbox_select_atomID ; atom_props_list_update} bind .fRright.fRatomPROPS.listbox \ {listbox_select_atomPROP ; atom_props_list_update} ##+##################################################################### ##+##################################################################### ## DEFINE PROCEDURES: ## 'listbox_select_atomID' - called by a button1-release binding on ## the AtomIDs listbox widget. ## 'listbox_select_atomPROP' - called by a button1-release binding on ## the AtomPROPS listbox widget. ## ## 'atom_props_list_update' - called by button1-release bindings on ## the atomIDs and atomPROPS listboxes --- and ## called in the 'Additional GUI Initialization' ## section at the bottom of this script. ## ## 'put_vars' - called by the 'UseIt' button ## 'popup_msg_var_scroll' - called by the 'Help' button ##+##################################################################### ##+##################################################################### ##+################################################################ ## PROC 'listbox_select_atomID' ##+################################################################ ## PURPOSE: Sets some 'atom-ID' variables depending on the ## line selected in the AtomIDs listbox . ## ## CALLED BY: binding on the AtomIDs listbox widget ##+################################################################ proc listbox_select_atomID {} { global SELatomNUM SEPchar set sel_index [ .fRright.fRatomIDs.listbox curselection ] # puts "sel_index: $sel_index" if { "$sel_index" != "" } { set selectedLINE [ .fRright.fRatomIDs.listbox get $sel_index ] } ## FOR TESTING: # puts "listbox_select_atomID: selectedLINE = $selectedLINE" ## Load the 3 atom IDs of the selected atom into 3 SEL variables and ## set the ID in a text widget at the top of the GUI. set tempLIST [split "$selectedLINE" $SEPchar] set SELatomNUM [string trim [lindex "$tempLIST" 0]] set TEMPatomSYM [string trim [lindex "$tempLIST" 1]] set TEMPatomNAME [string trim [lindex "$tempLIST" 2]] ## FOR TESTING: (change 0 to 1 to activate) if {0} { puts "" puts "proc listbox_select_atomID:" puts "selectedLINE: $selectedLINE" puts "sel_index: $sel_index" puts "tempLIST: $tempLIST" puts "SELatomNUM: $SELatomNUM" puts "TEMPatomSYM: $TEMPatomSYM" puts "TEMPatomNAME: $TEMPatomNAME" puts "" } .fRbuttons.txtATOMidSel delete 1.0 end .fRbuttons.txtATOMidSel insert end "$selectedLINE" return } ## END OF PROC 'listbox_select_atomID' ##+################################################################ ## PROC 'listbox_select_atomPROP' ##+################################################################ ## PURPOSE: Sets some 'atom-property' variables depending on the ## line selected in the AtomPROPS listbox . ## ## CALLED BY: binding on the AtomPROPS listbox widget ##+################################################################ proc listbox_select_atomPROP {} { global SELpropTYPE SEPchar set sel_index [ .fRright.fRatomPROPS.listbox curselection ] if { "$sel_index" != "" } { set selectedLINE [ .fRright.fRatomPROPS.listbox get $sel_index ] } ## FOR TESTING: (change 0 to 1 to activate) if {0} { puts "" puts "proc listbox_select_atomPROP:" puts "sel_index: $sel_index" puts "selectedLINE: $selectedLINE" puts "" } ## Load in the selected property-type into the SELpropTYPE variable and ## set the selected-property-type in a text widget at the top of the GUI. set SELpropTYPE "$selectedLINE" .fRbuttons.txtATOMpropSel delete 1.0 end .fRbuttons.txtATOMpropSel insert end "$selectedLINE" return } ## END OF PROC 'listbox_select_atomPROP' ##+##################################################################### ## PROC: 'atom_props_list_update' ##+##################################################################### ## ## PURPOSE: Use the variable SELatomNUM and the array variables ## like aRatomDENSITY, aRatomMELTPT, aRatomBOILPT, ... ## to set a text variable --- and put that text variable ## into the text-area widget. ## ## CALLED BY: bindings on the 2 listbox widgets --- and in the ## 'Additional GUI Initialization' section at the ## bottom of the script. ##+##################################################################### proc atom_props_list_update {} { ## Dummy out this proc, for testing. # return global SELatomNUM \ aRatomSYM aRatomNAME \ aRatomWEIGHT aRatomDENSITY \ aRatomMELTPT aRatomBOILPT aRatomABUND ########################################################### ## Build a text variable for use below, in setting the text ## in the text-area of the GUI. ########################################################### set tempTEXT "Atomic Number: $SELatomNUM Atomic Symbol: $aRatomSYM($SELatomNUM) Atomic Name: $aRatomNAME($SELatomNUM) Atomic Weight: $aRatomWEIGHT($SELatomNUM) Density: $aRatomDENSITY($SELatomNUM) Melting Point: $aRatomMELTPT($SELatomNUM) Boiling Point: $aRatomBOILPT($SELatomNUM) Abundance: $aRatomABUND($SELatomNUM) " ############################################# ## Insert the built text into the text area. ############################################# .fRleft.text delete 1.0 end .fRleft.text insert end "$tempTEXT" } ## END of proc 'atom_props_list_update' ##+##################################################################### ## PROC: 'put_vars' ## ## PURPOSED: Put contents of 5 global variables --- containing ## atomic-number, atomic-symbol, atomic-name, ## atomic-property-type, atomic-property-value ## --- to standard output. ## ## CALLED BY: button .fRbuttons.buttUSEIT ##+##################################################################### proc put_vars { } { global SELatomNUM SELpropTYPE SEPchar \ aRatomSYM aRatomNAME \ aRatomWEIGHT aRatomDENSITY \ aRatomMELTPT aRatomBOILPT aRatomABUND if {"$SELpropTYPE" == "atomic-weight"} { set PROPvalue "$aRatomWEIGHT($SELatomNUM)" } elseif {"$SELpropTYPE" == "density"} { set PROPvalue "$aRatomDENSITY($SELatomNUM)" } elseif {"$SELpropTYPE" == "melting-point"} { set PROPvalue "$aRatomMELTPT($SELatomNUM)" } elseif {"$SELpropTYPE" == "boiling-point"} { set PROPvalue "$aRatomBOILPT($SELatomNUM)" } elseif {"$SELpropTYPE" == "abundance"} { set PROPvalue "$aRatomABUND($SELatomNUM)" } else { set PROPvalue "" } puts "$SELatomNUM $SEPchar $aRatomSYM($SELatomNUM) \ $SEPchar $aRatomNAME($SELatomNUM) $aRatomSYM($SELatomNUM) $SEPchar \ $SELpropTYPE $SEPchar $PROPvalue" exit } ## END of proc 'puts_vars' ##+##################################################################### ## PROC 'advise_user' ##+##################################################################### ## PURPOSE: Puts a message to the user on the GUI. ## ## CALLED BY: the 'Additional GUI Initialization' section at ## the bottom of this script. ## May also be called by some procs such as ## 'atom_props_list_update'. ##+##################################################################### proc advise_user {text} { .fRmsg.labelMSG configure -text "$text" ## Make sure the text is displayed on the GUI. update ## Alternatively, we could put the message in the title-bar ## of the GUI window. (But it is easy for the user to ## fail to see the message there. Besides, we have more ## options in displaying the message by putting it on a ## Tk widget in the GUI.) ## # wm title . "$text" } ## END OF PROC 'advise_user' ##+######################################################################## ## PROC 'popup_msg_var_scroll' ##+######################################################################## ## PURPOSE: Report help or error conditions to the user. ## CALLED BY: 'help' button ##+######################################################################## ## To have more control over the formatting of the message (esp. ## words per line), we use this 'toplevel-text' method, ## rather than the 'tk_dialog' method -- like on page 574 of the book ## by Hattie Schroeder & Mike Doyel,'Interactive Web Applications ## with Tcl/Tk', Appendix A "ED, the Tcl Code Editor". ##+######################################################################## proc popup_msg_var_scroll { VARtext } { ## global fontTEMP_text #; Not needed. 'wish' makes this global. ## global env # bell # bell ################################################# ## Set VARwidth & VARheight from $VARtext. ################################################# ## To get VARheight, ## split at '\n' (newlines) and count 'lines'. ################################################# set VARlist [ split $VARtext "\n" ] ## For testing: # puts "VARlist: $VARlist" set VARheight [ llength $VARlist ] ## For testing: # puts "VARheight: $VARheight" ################################################# ## To get VARwidth, ## loop through the 'lines' getting length ## of each; save max. ################################################# set VARwidth 0 ############################################# ## LOOK AT EACH LINE IN THE LIST. ############################################# foreach line $VARlist { ############################################# ## Get the length of the line. ############################################# set LINEwidth [ string length $line ] if { $LINEwidth > $VARwidth } { set VARwidth $LINEwidth } } ## END OF foreach line $VARlist ## For testing: # puts "VARwidth: $VARwidth" ############################################################### ## NOTE: VARwidth works for a fixed-width font used for the ## text widget ... BUT the programmer may need to be ## careful that the contents of VARtext are all ## countable characters by the 'string length' command. ############################################################### ##################################### ## SETUP 'TOP LEVEL' HELP WINDOW. ##################################### catch {destroy .topmsg} toplevel .topmsg # wm geometry .topmsg 600x400+100+50 wm geometry .topmsg +100+50 wm title .topmsg "Note" # wm title .topmsg "Note to $env(USER)" wm iconname .topmsg "Note" ##################################### ## DEFINE & PACK TEXT WIDGET. ##################################### text .topmsg.text \ -wrap none \ -font fontTEMP_text \ -width $VARwidth \ -height $VARheight \ -bg "#f0f0f0" \ -relief raised \ -bd 2 \ -yscrollcommand ".topmsg.scrolly set" \ -xscrollcommand ".topmsg.scrollx set" scrollbar .topmsg.scrolly \ -orient vertical \ -command ".topmsg.text yview" scrollbar .topmsg.scrollx \ -orient horizontal \ -command ".topmsg.text xview" ## Pack the scrollbars BEFORE the text widget, ## so that the text does not monopolize the space. pack .topmsg.scrolly \ -side right \ -anchor center \ -fill y \ -expand 0 ## DO NOT USE '-expand 1' HERE on the Y-scrollbar. ## THAT ALLOWS Y-SCROLLBAR TO EXPAND AND PUTS ## BLANK SPACE BETWEEN Y-SCROLLBAR & THE TEXT AREA. pack .topmsg.scrollx \ -side bottom \ -anchor center \ -fill x \ -expand 0 ## DO NOT USE '-expand 1' HERE on the X-scrollbar. ## THAT KEEPS THE TEXT AREA FROM EXPANDING. pack .topmsg.text \ -side top \ -anchor center \ -fill both \ -expand 1 ##################################### ## DEFINE & PACK OK BUTTON WIDGET. ##################################### button .topmsg.butt \ -text "OK" \ -command "destroy .topmsg" pack .topmsg.butt \ -side bottom \ -anchor center \ -fill none \ -expand 0 ##################################### ## LOAD MSG INTO TEXT WIDGET. ##################################### ## .topmsg.text delete 1.0 end .topmsg.text insert end $VARtext .topmsg.text configure -state disabled } ## END OF PROC 'popup_msg_var_scroll' ##+############################################### ## END OF PROCS SECTION. ##+############################################### ## SET HELP TEXT variable. ##+############################################### set HELPtext \ " ************ Tk ATOM (and property) SELECTOR Utility ********* This Tk GUI script provides a GUI for SELECTING AN ATOM and showing a list of many of its properties in a text-area on the GUI. In addition, the user can SELECT an atomic property type --- such as atomic-weight or density or melting-point or boiling-point or whatever. Then, by clicking on a 'UseIt' button on the GUI, 'results' are written to 'stdout'. The 'results' include 5 items --- 3 atom IDs (number, symbol, and name) and a property-type-name and its value for the selected atom. The GUI provides 2 listboxes: - one to select an atom from a list of about 100 and - one to select an atomic property from a list of about 5 to 20. The atom-IDs listbox shows 3 identifying items on each line of the listbox: - atomic number (such as 1) - atomic symbol (such as 'H') - atomic name (such as 'Hydrogen'). Example line: 1 ; H ; Hydrogen ********** OPERATION: ********** When the user selects an atom line from the atom-IDs listbox on the right, the text area on the left updates with a list properties of the selected atom. The user can then select a property-type, from the the property-types listbox on the lower right. Then the user can click on the 'UseIt' button, and a string of 'results' are sent, as a string, to 'stdout'. The results string consists of five items of the form: atom-NUMBER atom-SYMBOL atom-NAME propertyTYPE propertyVALUE Example: 1 ; H ; Hydrogen ; density ; 0.00008988 g/cm3 Note that the 'propertyVALUE' may include a string that indicates the unit-of-measure. With this 'selection' capability, this Tk script can be called IN A SHELL SCRIPT OR IN ANOTHER TK SCRIPT, so that this Tk script can ACT AS AN ATOM (and property) SELECTOR utility. *************************** SOURCES OF PROPERTIES DATA: *************************** The atomic properties data for these atoms was adapted from the page https://en.wikipedia.org/wiki/List_of_elements For details on the nature of the numbers --- such as how the (average) atomic weights were determined and how the 'abundance' data was determined --- see that Wikipedia page. Some other sources of atomic data: micro-properties data: https://en.wikipedia.org/wiki/List_of_elements_by_atomic_properties periodic tables: https://en.wikipedia.org/wiki/Alternative_periodic_tables periodic tables groups: https://en.wikipedia.org/wiki/Category:Groups_in_the_periodic_table discoverers: https://en.wikipedia.org/wiki/Timeline_of_chemical_element_discoveries See the links and references on these pages for even more data sources. " ##+############################################### ##+############################################### ## ADDITONAL GUI INITIALIZATION section FOLLOWS. ##+############################################### ##+############################################### ##+################################################# ## Set the separation character for the 3 atom IDs ## in the lines of the AtomIDs listbox. ##+################################################# set SEPchar ";" # set SEPchar "#" ##+###################################################### ## LOAD the AtomIDs listbox --- and load the ## several 'aRatom' arrays for each atom. ##+###################################################### ## REFERENCES - Sources of properties data: ## ## * macro-properties data: https://en.wikipedia.org/wiki/List_of_elements ## micro-properties data: https://en.wikipedia.org/wiki/List_of_elements_by_atomic_properties ## ## discoverers: https://en.wikipedia.org/wiki/Timeline_of_chemical_element_discoveries ## periodic tables: https://en.wikipedia.org/wiki/Alternative_periodic_tables ## peirodic tables groups: https://en.wikipedia.org/wiki/Category:Groups_in_the_periodic_table ## ##+###################################################### .fRright.fRatomIDs.listbox delete 0 end set aRatomSYM(1) "H" set aRatomNAME(1) "Hydrogen" .fRright.fRatomIDs.listbox insert end \ "1 $SEPchar $aRatomSYM(1) $SEPchar $aRatomNAME(1)" set aRatomWEIGHT(1) "1.008" set aRatomDENSITY(1) "0.00008988 g/cm3" set aRatomMELTPT(1) "14.01 K" set aRatomBOILPT(1) "20.28 K" set aRatomABUND(1) "1400 mg/kg" set aRatomSYM(2) "He" set aRatomNAME(2) "Helium" .fRright.fRatomIDs.listbox insert end \ "2 $SEPchar $aRatomSYM(2) $SEPchar $aRatomNAME(2)" set aRatomWEIGHT(2) "4.00260" set aRatomDENSITY(2) "0.0001785 g/cm3" set aRatomMELTPT(2) "0.95 K" set aRatomBOILPT(2) "4.22 K" set aRatomABUND(2) "0.008 mg/kg" set aRatomSYM(3) "Li" set aRatomNAME(3) "Lithium" .fRright.fRatomIDs.listbox insert end \ "3 $SEPchar $aRatomSYM(3) $SEPchar $aRatomNAME(3)" set aRatomWEIGHT(3) "6.94" set aRatomDENSITY(3) "0.534 g/cm3" set aRatomMELTPT(3) "453.69 K" set aRatomBOILPT(3) "1560 K" set aRatomABUND(3) "20. mg/kg" set aRatomSYM(4) "Be" set aRatomNAME(4) "Beryllium" .fRright.fRatomIDs.listbox insert end \ "4 $SEPchar $aRatomSYM(4) $SEPchar $aRatomNAME(4)" set aRatomWEIGHT(4) "9.01218" set aRatomDENSITY(4) "1.85 g/cm3" set aRatomMELTPT(4) "1560 K" set aRatomBOILPT(4) "2742 K" set aRatomABUND(4) "2.8 mg/kg" set aRatomSYM(5) "B" set aRatomNAME(5) "Boron" .fRright.fRatomIDs.listbox insert end \ "5 $SEPchar $aRatomSYM(5) $SEPchar $aRatomNAME(5)" set aRatomWEIGHT(5) "10.81" set aRatomDENSITY(5) "2.34 g/cm3" set aRatomMELTPT(5) "2349 K" set aRatomBOILPT(5) "4200 K" set aRatomABUND(5) "10. mg/kg" set aRatomSYM(6) "C" set aRatomNAME(6) "Carbon" .fRright.fRatomIDs.listbox insert end \ "6 $SEPchar $aRatomSYM(6) $SEPchar $aRatomNAME(6)" set aRatomWEIGHT(6) "12.011" set aRatomDENSITY(6) "2.267 g/cm3" set aRatomMELTPT(6) "3800 K" set aRatomBOILPT(6) "4300 K" set aRatomABUND(6) "200. mg/kg" set aRatomSYM(7) "N" set aRatomNAME(7) "Nitrogen" .fRright.fRatomIDs.listbox insert end \ "7 $SEPchar $aRatomSYM(7) $SEPchar $aRatomNAME(7)" set aRatomWEIGHT(7) "14.007" set aRatomDENSITY(7) "0.0012506 g/cm3" set aRatomMELTPT(7) "63.15 K" set aRatomBOILPT(7) "77.36 K" set aRatomABUND(7) "19. mg/kg" set aRatomSYM(8) "O" set aRatomNAME(8) "Oxygen" .fRright.fRatomIDs.listbox insert end \ "8 $SEPchar $aRatomSYM(8) $SEPchar $aRatomNAME(8)" set aRatomWEIGHT(8) "15.999" set aRatomDENSITY(8) "0.001429 g/cm3" set aRatomMELTPT(8) "54.36 K" set aRatomBOILPT(8) "90.20 K" set aRatomABUND(8) "461000 mg/kg" set aRatomSYM(9) "F" set aRatomNAME(9) "Flourine" .fRright.fRatomIDs.listbox insert end \ "9 $SEPchar $aRatomSYM(9) $SEPchar $aRatomNAME(9)" set aRatomWEIGHT(9) "18.99840" set aRatomDENSITY(9) "0.001696 g/cm3" set aRatomMELTPT(9) "53.53 K" set aRatomBOILPT(9) "85.03 K" set aRatomABUND(9) "585. mg/kg" ##+############### 10's ################### set aRatomSYM(10) "Ne" set aRatomNAME(10) "Neon" .fRright.fRatomIDs.listbox insert end \ "10 $SEPchar $aRatomSYM(10) $SEPchar $aRatomNAME(10)" set aRatomWEIGHT(10) "20.1797" set aRatomDENSITY(10) "0.0008999 g/cm3" set aRatomMELTPT(10) "24.56 K" set aRatomBOILPT(10) "27.07 K" set aRatomABUND(10) "0.005 mg/kg" set aRatomSYM(11) "Na" set aRatomNAME(11) "Sodium" .fRright.fRatomIDs.listbox insert end \ "11 $SEPchar $aRatomSYM(11) $SEPchar $aRatomNAME(11)" set aRatomWEIGHT(11) "22.98977" set aRatomDENSITY(11) "0.971 g/cm3" set aRatomMELTPT(11) "370.87 K" set aRatomBOILPT(11) "1156 K" set aRatomABUND(11) "23600 mg/kg" set aRatomSYM(12) "Mg" set aRatomNAME(12) "Magnesium" .fRright.fRatomIDs.listbox insert end \ "12 $SEPchar $aRatomSYM(12) $SEPchar $aRatomNAME(12)" set aRatomWEIGHT(12) "24.305" set aRatomDENSITY(12) "1.738 g/cm3" set aRatomMELTPT(12) "923 K" set aRatomBOILPT(12) "1363 K" set aRatomABUND(12) "23300 mg/kg" set aRatomSYM(13) "Al" set aRatomNAME(13) "Aluminum" .fRright.fRatomIDs.listbox insert end \ "13 $SEPchar $aRatomSYM(13) $SEPchar $aRatomNAME(13)" set aRatomWEIGHT(13) 26.98154" set aRatomDENSITY(13) "2.698 g/cm3" set aRatomMELTPT(13) "933.47 K" set aRatomBOILPT(13) "2792 K" set aRatomABUND(13) "82300 mg/kg" set aRatomSYM(14) "Si" set aRatomNAME(14) "Silicon" .fRright.fRatomIDs.listbox insert end \ "14 $SEPchar $aRatomSYM(14) $SEPchar $aRatomNAME(14)" set aRatomWEIGHT(14) "28.085" set aRatomDENSITY(14) "2.3296 g/cm3" set aRatomMELTPT(14) "1687 K" set aRatomBOILPT(14) "3538 K" set aRatomABUND(14) "282000 mg/kg" set aRatomSYM(15) "P" set aRatomNAME(15) "Phosphorus" .fRright.fRatomIDs.listbox insert end \ "15 $SEPchar $aRatomSYM(15) $SEPchar $aRatomNAME(15)" set aRatomWEIGHT(15) "30.97376" set aRatomDENSITY(15) "1.82 g/cm3" set aRatomMELTPT(15) "317.30 K" set aRatomBOILPT(15) "550 K" set aRatomABUND(15) "1050 mg/kg" set aRatomSYM(16) "S" set aRatomNAME(16) "Sulfur" .fRright.fRatomIDs.listbox insert end \ "16 $SEPchar $aRatomSYM(16) $SEPchar $aRatomNAME(16)" set aRatomWEIGHT(16) "32.06" set aRatomDENSITY(16) "2.067 g/cm3" set aRatomMELTPT(16) "388.36 K" set aRatomBOILPT(16) "717.87 K" set aRatomABUND(16) "350 mg/kg" set aRatomSYM(17) "Cl" set aRatomNAME(17) "Chlorine" .fRright.fRatomIDs.listbox insert end \ "17 $SEPchar $aRatomSYM(17) $SEPchar $aRatomNAME(17)" set aRatomWEIGHT(17) "35.45" set aRatomDENSITY(17) "0.003214 g/cm3" set aRatomMELTPT(17) "171.6 K" set aRatomBOILPT(17) "239.11 K" set aRatomABUND(17) "145 mg/kg" set aRatomSYM(18) "Ar" set aRatomNAME(18) "Argon" .fRright.fRatomIDs.listbox insert end \ "18 $SEPchar $aRatomSYM(18) $SEPchar $aRatomNAME(18)" set aRatomWEIGHT(18) 39.948" set aRatomDENSITY(18) "0.0017837 g/cm3" set aRatomMELTPT(18) "83.80 K" set aRatomBOILPT(18) "87.30 K" set aRatomABUND(18) "3.5 mg/kg" set aRatomSYM(19) "K" set aRatomNAME(19) "Potassium" .fRright.fRatomIDs.listbox insert end \ "19 $SEPchar $aRatomSYM(19) $SEPchar $aRatomNAME(19)" set aRatomWEIGHT(19) "39.0983" set aRatomDENSITY(19) "0.862 g/cm3" set aRatomMELTPT(19) "336.53 K" set aRatomBOILPT(19) "1032 K" set aRatomABUND(19) "20900 mg/kg" ##+############### 20's ################### set aRatomSYM(20) "Ca" set aRatomNAME(20) "Calcium" .fRright.fRatomIDs.listbox insert end \ "20 $SEPchar $aRatomSYM(20) $SEPchar $aRatomNAME(20)" set aRatomWEIGHT(20) "40.078" set aRatomDENSITY(20) "1.54 g/cm3" set aRatomMELTPT(20) "1115 K" set aRatomBOILPT(20) "1757 K" set aRatomABUND(20) "41500 mg/kg" set aRatomSYM(21) "Sc" set aRatomNAME(21) "Scandium" .fRright.fRatomIDs.listbox insert end \ "21 $SEPchar $aRatomSYM(21) $SEPchar $aRatomNAME(21)" set aRatomWEIGHT(21) "44.95591" set aRatomDENSITY(21) "2.989 g/cm3" set aRatomMELTPT(21) "1814 K" set aRatomBOILPT(21) "3109 K" set aRatomABUND(21) "22 mg/kg" set aRatomSYM(22) "Ti" set aRatomNAME(22) "Titanium" .fRright.fRatomIDs.listbox insert end \ "22 $SEPchar $aRatomSYM(22) $SEPchar $aRatomNAME(22)" set aRatomWEIGHT(22) "47.867" set aRatomDENSITY(22) "4.54 g/cm3" set aRatomMELTPT(22) "1941 K" set aRatomBOILPT(22) "3560 K" set aRatomABUND(22) "5650 mg/kg" set aRatomSYM(23) "V" set aRatomNAME(23) "Vanadium" .fRright.fRatomIDs.listbox insert end \ "23 $SEPchar $aRatomSYM(23) $SEPchar $aRatomNAME(23)" set aRatomWEIGHT(23) "50.9415" set aRatomDENSITY(23) "6.11 g/cm3" set aRatomMELTPT(23) "2183 K" set aRatomBOILPT(23) "3680 K" set aRatomABUND(23) "120 mg/kg" set aRatomSYM(24) "Cr" set aRatomNAME(24) "Chromium" .fRright.fRatomIDs.listbox insert end \ "24 $SEPchar $aRatomSYM(24) $SEPchar $aRatomNAME(24)" set aRatomWEIGHT(24) "51.9961" set aRatomDENSITY(24) "7.15 g/cm3" set aRatomMELTPT(24) "2180 K" set aRatomBOILPT(24) "2944 K" set aRatomABUND(24) "102 mg/kg" set aRatomSYM(25) "Mn" set aRatomNAME(25) "Manganese" .fRright.fRatomIDs.listbox insert end \ "25 $SEPchar $aRatomSYM(25) $SEPchar $aRatomNAME(25)" set aRatomWEIGHT(25) "54.938044" set aRatomDENSITY(25) "7.44 g/cm3" set aRatomMELTPT(25) "1519 K" set aRatomBOILPT(25) "2334 K" set aRatomABUND(25) "950 mg/kg" set aRatomSYM(26) "Fe" set aRatomNAME(26) "Iron" .fRright.fRatomIDs.listbox insert end \ "26 $SEPchar $aRatomSYM(26) $SEPchar $aRatomNAME(26)" set aRatomWEIGHT(26) "55.845" set aRatomDENSITY(26) "7.874 g/cm3" set aRatomMELTPT(26) "1811 K" set aRatomBOILPT(26) "3134 K" set aRatomABUND(26) "56300 mg/kg" set aRatomSYM(27) "Co" set aRatomNAME(27) "Cobalt" .fRright.fRatomIDs.listbox insert end \ "27 $SEPchar $aRatomSYM(27) $SEPchar $aRatomNAME(27)" set aRatomWEIGHT(27) "58.93319" set aRatomDENSITY(27) "8.86 g/cm3" set aRatomMELTPT(27) "1768 K" set aRatomBOILPT(27) "3200 K" set aRatomABUND(27) "25 mg/kg" set aRatomSYM(28) "Ni" set aRatomNAME(28) "Nickel" .fRright.fRatomIDs.listbox insert end \ "28 $SEPchar $aRatomSYM(28) $SEPchar $aRatomNAME(28)" set aRatomWEIGHT(28) "58.6934" set aRatomDENSITY(28) "8.912 g/cm3" set aRatomMELTPT(28) "1728 K" set aRatomBOILPT(28) "3186 K" set aRatomABUND(28) "84 mg/kg" set aRatomSYM(29) "Cu" set aRatomNAME(29) "Copper" .fRright.fRatomIDs.listbox insert end \ "29 $SEPchar $aRatomSYM(29) $SEPchar $aRatomNAME(29)" set aRatomWEIGHT(29) "63.546" set aRatomDENSITY(29) "8.96 g/cm3" set aRatomMELTPT(29) "1357.77 K" set aRatomBOILPT(29) "2835 K" set aRatomABUND(29) "60 mg/kg" ##+############### 30's ################### set aRatomSYM(30) "Zn" set aRatomNAME(30) "Zinc" .fRright.fRatomIDs.listbox insert end \ "30 $SEPchar $aRatomSYM(30) $SEPchar $aRatomNAME(30)" set aRatomWEIGHT(30) "65.38" set aRatomDENSITY(30) "7.134 g/cm3" set aRatomMELTPT(30) "692.88 K" set aRatomBOILPT(30) "1180 K" set aRatomABUND(30) "70 mg/kg" set aRatomSYM(31) "Ga" set aRatomNAME(31) "Gallium" .fRright.fRatomIDs.listbox insert end \ "31 $SEPchar $aRatomSYM(31) $SEPchar $aRatomNAME(31)" set aRatomWEIGHT(31) "69.723" set aRatomDENSITY(31) "5.907 g/cm3" set aRatomMELTPT(31) "302.9146 K" set aRatomBOILPT(31) "2477 K" set aRatomABUND(31) "19 mg/kg" set aRatomSYM(32) "Ge" set aRatomNAME(32) "Geranium" .fRright.fRatomIDs.listbox insert end \ "32 $SEPchar $aRatomSYM(32) $SEPchar $aRatomNAME(32)" set aRatomWEIGHT(32) "72.630" set aRatomDENSITY(32) "5.323 g/cm3" set aRatomMELTPT(32) "1211.40 K" set aRatomBOILPT(32) "3106 K" set aRatomABUND(32) "1.5 mg/kg" set aRatomSYM(33) "As" set aRatomNAME(33) "Arsenic" .fRright.fRatomIDs.listbox insert end \ "33 $SEPchar $aRatomSYM(33) $SEPchar $aRatomNAME(33)" set aRatomWEIGHT(33) "74.92159" set aRatomDENSITY(33) "5.77 g/cm3" set aRatomMELTPT(33) "1090 K @ 28 atmospheres" set aRatomBOILPT(33) "887 K" set aRatomABUND(33) "1.8 mg/kg" set aRatomSYM(34) "Se" set aRatomNAME(34) "Selenium" .fRright.fRatomIDs.listbox insert end \ "34 $SEPchar $aRatomSYM(34) $SEPchar $aRatomNAME(34)" set aRatomWEIGHT(34) "78.971" set aRatomDENSITY(34) "4.809 g/cm3" set aRatomMELTPT(34) "453 K" set aRatomBOILPT(34) "958 K" set aRatomABUND(34) "0.05 mg/kg" set aRatomSYM(35) "Br" set aRatomNAME(35) "Bromine" .fRright.fRatomIDs.listbox insert end \ "35 $SEPchar $aRatomSYM(35) $SEPchar $aRatomNAME(35)" set aRatomWEIGHT(35) "79.904" set aRatomDENSITY(35) "3.122 g/cm3" set aRatomMELTPT(35) "265.8 K" set aRatomBOILPT(35) "332.0 K" set aRatomABUND(35) "2.4 mg/kg" set aRatomSYM(36) "Kr" set aRatomNAME(36) "Krypton" .fRright.fRatomIDs.listbox insert end \ "36 $SEPchar $aRatomSYM(36) $SEPchar $aRatomNAME(36)" set aRatomWEIGHT(36) "83.798" set aRatomDENSITY(36) "0.003733 g/cm3" set aRatomMELTPT(36) "115.79 K" set aRatomBOILPT(36) "119.93 K" set aRatomABUND(36) "0.0001 mg/kg" set aRatomSYM(37) "Rb" set aRatomNAME(37) "Rubidium" .fRright.fRatomIDs.listbox insert end \ "37 $SEPchar $aRatomSYM(37) $SEPchar $aRatomNAME(37)" set aRatomWEIGHT(37) "85.4678" set aRatomDENSITY(37) "1.532 g/cm3" set aRatomMELTPT(37) "312.46 K" set aRatomBOILPT(37) "961 K" set aRatomABUND(37) "90 mg/kg" set aRatomSYM(38) "Sr" set aRatomNAME(38) "Strontium" .fRright.fRatomIDs.listbox insert end \ "38 $SEPchar $aRatomSYM(38) $SEPchar $aRatomNAME(38)" set aRatomWEIGHT(38) "87.62" set aRatomDENSITY(38) "2.64 g/cm3" set aRatomMELTPT(38) "1050 K" set aRatomBOILPT(38) "1655 K" set aRatomABUND(38) "370 mg/kg" set aRatomSYM(39) "Y" set aRatomNAME(39) "Yttrium" .fRright.fRatomIDs.listbox insert end \ "39 $SEPchar $aRatomSYM(39) $SEPchar $aRatomNAME(39)" set aRatomWEIGHT(39) "88.90584" set aRatomDENSITY(39) "4.469 g/cm3" set aRatomMELTPT(39) "1799 K" set aRatomBOILPT(39) "3609 K" set aRatomABUND(39) "33 mg/kg" ##+############### 40's ################### set aRatomSYM(40) "Zr" set aRatomNAME(40) "Zirconium" .fRright.fRatomIDs.listbox insert end \ "40 $SEPchar $aRatomSYM(40) $SEPchar $aRatomNAME(40)" set aRatomWEIGHT(40) "91.224" set aRatomDENSITY(40) "6.506 g/cm3" set aRatomMELTPT(40) "2128 K" set aRatomBOILPT(40) "4682 K" set aRatomABUND(40) "165 mg/kg" set aRatomSYM(41) "Nb" set aRatomNAME(41) "Niobium" .fRright.fRatomIDs.listbox insert end \ "41 $SEPchar $aRatomSYM(41) $SEPchar $aRatomNAME(41)" set aRatomWEIGHT(41) "92.90637" set aRatomDENSITY(41) "8.57 g/cm3" set aRatomMELTPT(41) "2750 K" set aRatomBOILPT(41) "5017 K" set aRatomABUND(41) "20 mg/kg" set aRatomSYM(42) "Mo" set aRatomNAME(42) "Molybdenum" .fRright.fRatomIDs.listbox insert end \ "42 $SEPchar $aRatomSYM(42) $SEPchar $aRatomNAME(42)" set aRatomWEIGHT(42) "95.95" set aRatomDENSITY(42) "10.22 g/cm3" set aRatomMELTPT(42) "2896 K" set aRatomBOILPT(42) "4912 K" set aRatomABUND(42) "1.2 mg/kg" set aRatomSYM(43) "Tc" set aRatomNAME(43) "Technetium" .fRright.fRatomIDs.listbox insert end \ "43 $SEPchar $aRatomSYM(43) $SEPchar $aRatomNAME(43)" set aRatomWEIGHT(43) "98." set aRatomDENSITY(43) "11.5 g/cm3" set aRatomMELTPT(43) "2430 K" set aRatomBOILPT(43) "4538 K" set aRatomABUND(43) "0.000000003 mg/kg" set aRatomSYM(44) "Ru" set aRatomNAME(44) "Ruthenium" .fRright.fRatomIDs.listbox insert end \ "44 $SEPchar $aRatomSYM(44) $SEPchar $aRatomNAME(44)" set aRatomWEIGHT(44) "101.07" set aRatomDENSITY(44) "12.37 g/cm3" set aRatomMELTPT(44) "2607 K" set aRatomBOILPT(44) "4423 K" set aRatomABUND(44) "0.001 mg/kg" set aRatomSYM(45) "Rh" set aRatomNAME(45) "Rhodium" .fRright.fRatomIDs.listbox insert end \ "45 $SEPchar $aRatomSYM(45) $SEPchar $aRatomNAME(45)" set aRatomWEIGHT(45) "102.90550" set aRatomDENSITY(45) "12.41 g/cm3" set aRatomMELTPT(45) "2237 K" set aRatomBOILPT(45) "3968 K" set aRatomABUND(45) "0.001 mg/kg" set aRatomSYM(46) "Pd" set aRatomNAME(46) "Palladium" .fRright.fRatomIDs.listbox insert end \ "46 $SEPchar $aRatomSYM(46) $SEPchar $aRatomNAME(46)" set aRatomWEIGHT(46) "106.42" set aRatomDENSITY(46) "12.02 g/cm3" set aRatomMELTPT(46) "1828.05 K" set aRatomBOILPT(46) "3236 K" set aRatomABUND(46) "0.015 mg/kg" set aRatomSYM(47) "Ag" set aRatomNAME(47) "Silver" .fRright.fRatomIDs.listbox insert end \ "47 $SEPchar $aRatomSYM(47) $SEPchar $aRatomNAME(47)" set aRatomWEIGHT(47) "107.8682" set aRatomDENSITY(47) "10.501 g/cm3" set aRatomMELTPT(47) "1234.93 K" set aRatomBOILPT(47) "2435 K" set aRatomABUND(47) "0.075 mg/kg" set aRatomSYM(48) "Cd" set aRatomNAME(48) "Cadmium" .fRright.fRatomIDs.listbox insert end \ "48 $SEPchar $aRatomSYM(48) $SEPchar $aRatomNAME(48)" set aRatomWEIGHT(48) "112.414" set aRatomDENSITY(48) "8.69 g/cm3" set aRatomMELTPT(48) "594.22 K" set aRatomBOILPT(48) "1040 K" set aRatomABUND(48) "0.159 mg/kg" set aRatomSYM(49) "In" set aRatomNAME(49) "Indium" .fRright.fRatomIDs.listbox insert end \ "49 $SEPchar $aRatomSYM(49) $SEPchar $aRatomNAME(49)" set aRatomWEIGHT(49) "114.818" set aRatomDENSITY(49) "7.31 g/cm3" set aRatomMELTPT(49) "429.75 K" set aRatomBOILPT(49) "2345 K" set aRatomABUND(49) "0.25 mg/kg" ##+############### 50's ################### set aRatomSYM(50) "Sn" set aRatomNAME(50) "Tin" .fRright.fRatomIDs.listbox insert end \ "50 $SEPchar $aRatomSYM(50) $SEPchar $aRatomNAME(50)" set aRatomWEIGHT(50) "118.710" set aRatomDENSITY(50) "7.287 g/cm3" set aRatomMELTPT(50) "505.08 K" set aRatomBOILPT(50) "2875 K" set aRatomABUND(50) "2.3 mg/kg" set aRatomSYM(51) "Sb" set aRatomNAME(51) "Antimony" .fRright.fRatomIDs.listbox insert end \ "51 $SEPchar $aRatomSYM(51) $SEPchar $aRatomNAME(51)" set aRatomWEIGHT(51) "121.760" set aRatomDENSITY(51) "6.685 g/cm3" set aRatomMELTPT(51) "903.78 K" set aRatomBOILPT(51) "1860 K" set aRatomABUND(51) "0.2 mg/kg" set aRatomSYM(52) "Te" set aRatomNAME(52) "Tellurium" .fRright.fRatomIDs.listbox insert end \ "52 $SEPchar $aRatomSYM(52) $SEPchar $aRatomNAME(52)" set aRatomWEIGHT(52) "127.60" set aRatomDENSITY(52) "6.232 g/cm3" set aRatomMELTPT(52) "722.66 K" set aRatomBOILPT(52) "1261 K" set aRatomABUND(52) "0.001 mg/kg" set aRatomSYM(53) "I" set aRatomNAME(53) "Iodine" .fRright.fRatomIDs.listbox insert end \ "53 $SEPchar $aRatomSYM(53) $SEPchar $aRatomNAME(53)" set aRatomWEIGHT(53) "126.90447" set aRatomDENSITY(53) "4.93 g/cm3" set aRatomMELTPT(53) "386.85 K" set aRatomBOILPT(53) "457.4 K" set aRatomABUND(53) "0.45 mg/kg" set aRatomSYM(54) "Xe" set aRatomNAME(54) "Xenon" .fRright.fRatomIDs.listbox insert end \ "54 $SEPchar $aRatomSYM(54) $SEPchar $aRatomNAME(54)" set aRatomWEIGHT(54) "131.293" set aRatomDENSITY(54) "0.005887 g/cm3" set aRatomMELTPT(54) "161.4 K" set aRatomBOILPT(54) "165.03 K" set aRatomABUND(54) "0.00003 mg/kg" set aRatomSYM(55) "Cs" set aRatomNAME(55) "Cesium" .fRright.fRatomIDs.listbox insert end \ "55 $SEPchar $aRatomSYM(55) $SEPchar $aRatomNAME(55)" set aRatomWEIGHT(55) "132.90545" set aRatomDENSITY(55) "1.873 g/cm3" set aRatomMELTPT(55) "301.59 K" set aRatomBOILPT(55) "944 K" set aRatomABUND(55) "3 mg/kg" set aRatomSYM(56) "Ba" set aRatomNAME(56) "Barium" .fRright.fRatomIDs.listbox insert end \ "56 $SEPchar $aRatomSYM(56) $SEPchar $aRatomNAME(56)" set aRatomWEIGHT(56) "137.327" set aRatomDENSITY(56) "3.594 g/cm3" set aRatomMELTPT(56) "1000 K" set aRatomBOILPT(56) "2170 K" set aRatomABUND(56) "425 mg/kg" set aRatomSYM(57) "La" set aRatomNAME(57) "Lanthanum" .fRright.fRatomIDs.listbox insert end \ "57 $SEPchar $aRatomSYM(57) $SEPchar $aRatomNAME(57)" set aRatomWEIGHT(57) "138.90547" set aRatomDENSITY(57) "6.145 g/cm3" set aRatomMELTPT(57) "1193 K" set aRatomBOILPT(57) "3737 K" set aRatomABUND(57) "39 mg/kg" set aRatomSYM(58) "Ce" set aRatomNAME(58) "Cerium" .fRright.fRatomIDs.listbox insert end \ "58 $SEPchar $aRatomSYM(58) $SEPchar $aRatomNAME(58)" set aRatomWEIGHT(58) "140.116" set aRatomDENSITY(58) "6.77 g/cm3" set aRatomMELTPT(58) "1068 K" set aRatomBOILPT(58) "3716 K" set aRatomABUND(58) "66.5 mg/kg" set aRatomSYM(59) "Pr" set aRatomNAME(59) "Praseodymium" .fRright.fRatomIDs.listbox insert end \ "59 $SEPchar $aRatomSYM(59) $SEPchar $aRatomNAME(59)" set aRatomWEIGHT(59) "140.90766" set aRatomDENSITY(59) "6.773 g/cm3" set aRatomMELTPT(59) "1208 K" set aRatomBOILPT(59) "3793 K" set aRatomABUND(59) "9.2 mg/kg" ##+################ 60's ################## set aRatomSYM(60) "Nd" set aRatomNAME(60) "Neodymium" .fRright.fRatomIDs.listbox insert end \ "60 $SEPchar $aRatomSYM(60) $SEPchar $aRatomNAME(60)" set aRatomWEIGHT(60) "144.242" set aRatomDENSITY(60) "7.007 g/cm3" set aRatomMELTPT(60) "1297 K" set aRatomBOILPT(60) "3347 K" set aRatomABUND(60) "41.5 mg/kg" set aRatomSYM(61) "Pm" set aRatomNAME(61) "Prometheum" .fRright.fRatomIDs.listbox insert end \ "61 $SEPchar $aRatomSYM(61) $SEPchar $aRatomNAME(61)" set aRatomWEIGHT(61) "145." set aRatomDENSITY(61) "7.26 g/cm3" set aRatomMELTPT(61) "1315 K" set aRatomBOILPT(61) "3273 K" set aRatomABUND(61) "0.0000000000000000002 mg/kg" set aRatomSYM(62) "Sm" set aRatomNAME(62) "Samarium" .fRright.fRatomIDs.listbox insert end \ "62 $SEPchar $aRatomSYM(62) $SEPchar $aRatomNAME(62)" set aRatomWEIGHT(62) "150.36" set aRatomDENSITY(62) "7.52 g/cm3" set aRatomMELTPT(62) "1345 K" set aRatomBOILPT(62) "2067 K" set aRatomABUND(62) "7.05 mg/kg" set aRatomSYM(63) "Eu" set aRatomNAME(63) "Europium" .fRright.fRatomIDs.listbox insert end \ "63 $SEPchar $aRatomSYM(63) $SEPchar $aRatomNAME(63)" set aRatomWEIGHT(63) "151.964" set aRatomDENSITY(63) "5.243 g/cm3" set aRatomMELTPT(63) "1099 K" set aRatomBOILPT(63) "1802 K" set aRatomABUND(63) "2 mg/kg" set aRatomSYM(64) "Gd" set aRatomNAME(64) "Gadolinium" .fRright.fRatomIDs.listbox insert end \ "64 $SEPchar $aRatomSYM(64) $SEPchar $aRatomNAME(64)" set aRatomWEIGHT(64) "157.25" set aRatomDENSITY(64) "7.895 g/cm3" set aRatomMELTPT(64) "1585 K" set aRatomBOILPT(64) "3546 K" set aRatomABUND(64) "6.2 mg/kg" set aRatomSYM(65) "Tb" set aRatomNAME(65) "Terbium" .fRright.fRatomIDs.listbox insert end \ "65 $SEPchar $aRatomSYM(65) $SEPchar $aRatomNAME(65)" set aRatomWEIGHT(65) "158.92535" set aRatomDENSITY(65) "8.229 g/cm3" set aRatomMELTPT(65) "1629 K" set aRatomBOILPT(65) "3503 K" set aRatomABUND(65) "1.2 mg/kg" set aRatomSYM(66) "Dy" set aRatomNAME(66) "Dysprosium" .fRright.fRatomIDs.listbox insert end \ "66 $SEPchar $aRatomSYM(66) $SEPchar $aRatomNAME(66)" set aRatomWEIGHT(66) "162.500" set aRatomDENSITY(66) "8.55 g/cm3" set aRatomMELTPT(66) "1680 K" set aRatomBOILPT(66) "2840 K" set aRatomABUND(66) "5.2 mg/kg" set aRatomSYM(67) "Ho" set aRatomNAME(67) "Holmium" .fRright.fRatomIDs.listbox insert end \ "67 $SEPchar $aRatomSYM(67) $SEPchar $aRatomNAME(67)" set aRatomWEIGHT(67) "164.93033" set aRatomDENSITY(67) "8.795 g/cm3" set aRatomMELTPT(67) "1734 K" set aRatomBOILPT(67) "2993 K" set aRatomABUND(67) "1.3 mg/kg" set aRatomSYM(68) "Er" set aRatomNAME(68) "Erbium" .fRright.fRatomIDs.listbox insert end \ "68 $SEPchar $aRatomSYM(68) $SEPchar $aRatomNAME(68)" set aRatomWEIGHT(68) "167.259" set aRatomDENSITY(68) "9.066 g/cm3" set aRatomMELTPT(68) "1802 K" set aRatomBOILPT(68) "3141 K" set aRatomABUND(68) "3.5 mg/kg" set aRatomSYM(69) "Tm" set aRatomNAME(69) "Thulium" .fRright.fRatomIDs.listbox insert end \ "69 $SEPchar $aRatomSYM(69) $SEPchar $aRatomNAME(69)" set aRatomWEIGHT(69) "168.93422" set aRatomDENSITY(69) "9.321 g/cm3" set aRatomMELTPT(69) "1818 K" set aRatomBOILPT(69) "2223 K" set aRatomABUND(69) "0.52 mg/kg" ##+################## 70's ################## set aRatomSYM(70) "Yb" set aRatomNAME(70) "Ytterbium" .fRright.fRatomIDs.listbox insert end \ "70 $SEPchar $aRatomSYM(70) $SEPchar $aRatomNAME(70)" set aRatomWEIGHT(70) "173.045" set aRatomDENSITY(70) "6.965 g/cm3" set aRatomMELTPT(70) "1097 K" set aRatomBOILPT(70) "1469 K" set aRatomABUND(70) "3.2 mg/kg" set aRatomSYM(71) "Lu" set aRatomNAME(71) "Lutetium" .fRright.fRatomIDs.listbox insert end \ "71 $SEPchar $aRatomSYM(71) $SEPchar $aRatomNAME(71)" set aRatomWEIGHT(71) "174.9668" set aRatomDENSITY(71) "9.84 g/cm3" set aRatomMELTPT(71) "1925 K" set aRatomBOILPT(71) "3675 K" set aRatomABUND(71) "0.8 mg/kg" set aRatomSYM(72) "Hf" set aRatomNAME(72) "Hafnium" .fRright.fRatomIDs.listbox insert end \ "72 $SEPchar $aRatomSYM(72) $SEPchar $aRatomNAME(72)" set aRatomWEIGHT(72) "178.49" set aRatomDENSITY(72) "13.31 g/cm3" set aRatomMELTPT(72) "2506 K" set aRatomBOILPT(72) "4876 K" set aRatomABUND(72) "3 mg/kg" set aRatomSYM(73) "Ta" set aRatomNAME(73) "Tantalum" .fRright.fRatomIDs.listbox insert end \ "73 $SEPchar $aRatomSYM(73) $SEPchar $aRatomNAME(73)" set aRatomWEIGHT(73) "180.94788" set aRatomDENSITY(73) "16.654 g/cm3" set aRatomMELTPT(73) "3290 K" set aRatomBOILPT(73) "5731 K" set aRatomABUND(73) "2 mg/kg" set aRatomSYM(74) "W" set aRatomNAME(74) "Tungsten" .fRright.fRatomIDs.listbox insert end \ "74 $SEPchar $aRatomSYM(74) $SEPchar $aRatomNAME(74)" set aRatomWEIGHT(74) "183.84" set aRatomDENSITY(74) "19.25 g/cm3" set aRatomMELTPT(74) "3695 K" set aRatomBOILPT(74) "5828 K" set aRatomABUND(74) "1.3 mg/kg" set aRatomSYM(75) "Re" set aRatomNAME(75) "Rhenium" .fRright.fRatomIDs.listbox insert end \ "75 $SEPchar $aRatomSYM(75) $SEPchar $aRatomNAME(75)" set aRatomWEIGHT(75) "186.207" set aRatomDENSITY(75) "21.02 g/cm3" set aRatomMELTPT(75) "3459 K" set aRatomBOILPT(75) "5869 K" set aRatomABUND(75) "0.0007 mg/kg" set aRatomSYM(76) "Os" set aRatomNAME(76) "Osmium" .fRright.fRatomIDs.listbox insert end \ "76 $SEPchar $aRatomSYM(76) $SEPchar $aRatomNAME(76)" set aRatomWEIGHT(76) "190.23" set aRatomDENSITY(76) "22.61 g/cm3" set aRatomMELTPT(76) "3306 K" set aRatomBOILPT(76) "5285 K" set aRatomABUND(76) "0.002 mg/kg" set aRatomSYM(77) "Ir" set aRatomNAME(77) "Iridium" .fRright.fRatomIDs.listbox insert end \ "77 $SEPchar $aRatomSYM(77) $SEPchar $aRatomNAME(77)" set aRatomWEIGHT(77) "192.217" set aRatomDENSITY(77) "22.56 g/cm3" set aRatomMELTPT(77) "2719 K" set aRatomBOILPT(77) "4701 K" set aRatomABUND(77) "0.001 mg/kg" set aRatomSYM(78) "Pt" set aRatomNAME(78) "Platinum" .fRright.fRatomIDs.listbox insert end \ "78 $SEPchar $aRatomSYM(78) $SEPchar $aRatomNAME(78)" set aRatomWEIGHT(78) "195.084" set aRatomDENSITY(78) "21.46 g/cm3" set aRatomMELTPT(78) "2041.4 K" set aRatomBOILPT(78) "4098 K" set aRatomABUND(78) "0.005 mg/kg" set aRatomSYM(79) "Au" set aRatomNAME(79) "Gold" .fRright.fRatomIDs.listbox insert end \ "79 $SEPchar $aRatomSYM(79) $SEPchar $aRatomNAME(79)" set aRatomWEIGHT(79) "196.96657" set aRatomDENSITY(79) "19.282 g/cm3" set aRatomMELTPT(79) "1337.33 K" set aRatomBOILPT(79) "3129 K" set aRatomABUND(79) "0.004 mg/kg" ##+################ 80's ################ set aRatomSYM(80) "Hg" set aRatomNAME(80) "Mercury" .fRright.fRatomIDs.listbox insert end \ "80 $SEPchar $aRatomSYM(80) $SEPchar $aRatomNAME(80)" set aRatomWEIGHT(80) "200.592" set aRatomDENSITY(80) "13.5336 g/cm3" set aRatomMELTPT(80) "234.43 K" set aRatomBOILPT(80) "629.88 K" set aRatomABUND(80) "0.085 mg/kg" set aRatomSYM(81) "Tl" set aRatomNAME(81) "Thallium" .fRright.fRatomIDs.listbox insert end \ "81 $SEPchar $aRatomSYM(81) $SEPchar $aRatomNAME(81)" set aRatomWEIGHT(81) "204.38" set aRatomDENSITY(81) "11.85 g/cm3" set aRatomMELTPT(81) "577 K" set aRatomBOILPT(81) "1746 K" set aRatomABUND(81) "0.85 mg/kg" set aRatomSYM(82) "Pb" set aRatomNAME(82) "Lead" .fRright.fRatomIDs.listbox insert end \ "82 $SEPchar $aRatomSYM(82) $SEPchar $aRatomNAME(82)" set aRatomWEIGHT(82) "207.2" set aRatomDENSITY(82) "11.342 g/cm3" set aRatomMELTPT(82) "600.61 K" set aRatomBOILPT(82) "2022 K" set aRatomABUND(82) "14 mg/kg" set aRatomSYM(83) "Bi" set aRatomNAME(83) "Bismuth" .fRright.fRatomIDs.listbox insert end \ "83 $SEPchar $aRatomSYM(83) $SEPchar $aRatomNAME(83)" set aRatomWEIGHT(83) "208.98040" set aRatomDENSITY(83) "9.807 g/cm3" set aRatomMELTPT(83) "544.7 K" set aRatomBOILPT(83) "1837 K" set aRatomABUND(83) "0.009 mg/kg" set aRatomSYM(84) "Po" set aRatomNAME(84) "Polonium" .fRright.fRatomIDs.listbox insert end \ "84 $SEPchar $aRatomSYM(84) $SEPchar $aRatomNAME(84)" set aRatomWEIGHT(84) "209." set aRatomDENSITY(84) "9.32 g/cm3" set aRatomMELTPT(84) "527 K" set aRatomBOILPT(84) "1235 K" set aRatomABUND(84) "0.0000000002 mg/kg" set aRatomSYM(85) "At" set aRatomNAME(85) "Astatine" .fRright.fRatomIDs.listbox insert end \ "85 $SEPchar $aRatomSYM(85) $SEPchar $aRatomNAME(85)" set aRatomWEIGHT(85) "210." set aRatomDENSITY(85) "7. g/cm3" set aRatomMELTPT(85) "575 K" set aRatomBOILPT(85) "610 K" set aRatomABUND(85) "0.00000000000000000003 mg/kg" set aRatomSYM(86) "Rn" set aRatomNAME(86) "Radon" .fRright.fRatomIDs.listbox insert end \ "86 $SEPchar $aRatomSYM(86) $SEPchar $aRatomNAME(86)" set aRatomWEIGHT(86) "222." set aRatomDENSITY(86) "0.00973 g/cm3" set aRatomMELTPT(86) "202 K" set aRatomBOILPT(86) "211.3 K" set aRatomABUND(86) "0.0000000000004 mg/kg" set aRatomSYM(87) "Fr" set aRatomNAME(87) "Francium" .fRright.fRatomIDs.listbox insert end \ "87 $SEPchar $aRatomSYM(87) $SEPchar $aRatomNAME(87)" set aRatomWEIGHT(87) "223." set aRatomDENSITY(87) "1.87 g/cm3" set aRatomMELTPT(87) "300 K" set aRatomBOILPT(87) "950 K" set aRatomABUND(87) "0.000000000000000001 mg/kg" set aRatomSYM(88) "Ra" set aRatomNAME(88) "Radium" .fRright.fRatomIDs.listbox insert end \ "88 $SEPchar $aRatomSYM(88) $SEPchar $aRatomNAME(88)" set aRatomWEIGHT(88) "226." set aRatomDENSITY(88) "5.5 g/cm3" set aRatomMELTPT(88) "973 K" set aRatomBOILPT(88) "2010 K" set aRatomABUND(88) "0.000000009 mg/kg" set aRatomSYM(89) "Ac" set aRatomNAME(89) "Actinium" .fRright.fRatomIDs.listbox insert end \ "89 $SEPchar $aRatomSYM(89) $SEPchar $aRatomNAME(89)" set aRatomWEIGHT(89) "227." set aRatomDENSITY(89) "10.07 g/cm3" set aRatomMELTPT(89) "1323 K" set aRatomBOILPT(89) "3471 K" set aRatomABUND(89) "0.00000000055 mg/kg" ##+############## 90's ##################### set aRatomSYM(90) "Th" set aRatomNAME(90) "Thorium" .fRright.fRatomIDs.listbox insert end \ "90 $SEPchar $aRatomSYM(90) $SEPchar $aRatomNAME(90)" set aRatomWEIGHT(90) "232.0377" set aRatomDENSITY(90) "11.72 g/cm3" set aRatomMELTPT(90) "2115 K" set aRatomBOILPT(90) "5061 K" set aRatomABUND(90) "9.6 mg/kg" set aRatomSYM(91) "Pa" set aRatomNAME(91) "Protactinium" .fRright.fRatomIDs.listbox insert end \ "91 $SEPchar $aRatomSYM(91) $SEPchar $aRatomNAME(91)" set aRatomWEIGHT(91) "231.03588" set aRatomDENSITY(91) "15.37 g/cm3" set aRatomMELTPT(91) "1841 K" set aRatomBOILPT(91) "4300 K" set aRatomABUND(91) "0.0000014 mg/kg" set aRatomSYM(92) "U" set aRatomNAME(92) "Uranium" .fRright.fRatomIDs.listbox insert end \ "92 $SEPchar $aRatomSYM(92) $SEPchar $aRatomNAME(92)" set aRatomWEIGHT(92) "238.02891" set aRatomDENSITY(92) "18.95 g/cm3" set aRatomMELTPT(92) "1405.3 K" set aRatomBOILPT(92) "4404 K" set aRatomABUND(92) "2.7 mg/kg" set aRatomSYM(93) "Np" set aRatomNAME(93) "Neptunium" .fRright.fRatomIDs.listbox insert end \ "93 $SEPchar $aRatomSYM(93) $SEPchar $aRatomNAME(93)" set aRatomWEIGHT(93) "237." set aRatomDENSITY(93) "20.45 g/cm3" set aRatomMELTPT(93) "917 K" set aRatomBOILPT(93) "4273 K" set aRatomABUND(93) "0.000000000003 mg/kg" set aRatomSYM(94) "Pu" set aRatomNAME(94) "Plutonium" .fRright.fRatomIDs.listbox insert end \ "94 $SEPchar $aRatomSYM(94) $SEPchar $aRatomNAME(94)" set aRatomWEIGHT(94) "244." set aRatomDENSITY(94) "19.84 g/cm3" set aRatomMELTPT(94) "912.5 K" set aRatomBOILPT(94) "3501 K" set aRatomABUND(94) "0.0000000003 mg/kg" set aRatomSYM(95) "Am" set aRatomNAME(95) "Americium" .fRright.fRatomIDs.listbox insert end \ "95 $SEPchar $aRatomSYM(95) $SEPchar $aRatomNAME(95)" set aRatomWEIGHT(95) "243." set aRatomDENSITY(95) "13.69 g/cm3" set aRatomMELTPT(95) "1449 K" set aRatomBOILPT(95) "2880 K" set aRatomABUND(95) "0 mg/kg" set aRatomSYM(96) "Cm" set aRatomNAME(96) "Curium" .fRright.fRatomIDs.listbox insert end \ "96 $SEPchar $aRatomSYM(96) $SEPchar $aRatomNAME(96)" set aRatomWEIGHT(96) "247." set aRatomDENSITY(96) "13.51 g/cm3" set aRatomMELTPT(96) "1613 K" set aRatomBOILPT(96) "3383 K" set aRatomABUND(96) "0 mg/kg" set aRatomSYM(97) "Bk" set aRatomNAME(97) "Berkelium" .fRright.fRatomIDs.listbox insert end \ "97 $SEPchar $aRatomSYM(97) $SEPchar $aRatomNAME(97)" set aRatomWEIGHT(97) "247." set aRatomDENSITY(97) "14.79 g/cm3" set aRatomMELTPT(97) "1259 K" set aRatomBOILPT(97) "2900 K" set aRatomABUND(97) "0 mg/kg" set aRatomSYM(98) "Cf" set aRatomNAME(98) "Californium" .fRright.fRatomIDs.listbox insert end \ "98 $SEPchar $aRatomSYM(98) $SEPchar $aRatomNAME(98)" set aRatomWEIGHT(98) "251." set aRatomDENSITY(98) "15.1 g/cm3" set aRatomMELTPT(98) "1173 K" set aRatomBOILPT(98) "1743? K" set aRatomABUND(98) "0 mg/kg" set aRatomSYM(99) "Es" set aRatomNAME(99) "Einsteinium" .fRright.fRatomIDs.listbox insert end \ "99 $SEPchar $aRatomSYM(99) $SEPchar $aRatomNAME(99)" set aRatomWEIGHT(99) "252." set aRatomDENSITY(99) "8.84 g/cm3" set aRatomMELTPT(99) "1133 K" set aRatomBOILPT(99) "1269? K" set aRatomABUND(99) "0 mg/kg" ##+###################################################### ## LOAD the AtomPROPS listbox. ##+###################################################### .fRright.fRatomPROPS.listbox delete 0 end .fRright.fRatomPROPS.listbox insert end "atomic-weight" set aRpropListboxLine(atomic-weight) 0 .fRright.fRatomPROPS.listbox insert end "density" set aRpropListboxLine(density) 1 .fRright.fRatomPROPS.listbox insert end "melting-point" set aRpropListboxLine(melting-point) 2 .fRright.fRatomPROPS.listbox insert end "boiling-point" set aRpropListboxLine(boiling-point) 3 .fRright.fRatomPROPS.listbox insert end "abundance" set aRpropListboxLine(abundance) 4 ##+######################################################################## ## GET one or two INPUT ARGUMENT VALUES, if any. If none, set defaults. ## ## Use these 1 or 2 to set initial variable values --- SELatomNUM SELpropTYPE. ##+######################################################################## if {$argc == 2} { set SELatomNUM [lindex $argv 0] set SELpropTYPE [lindex $argv 1] } elseif {$argc == 1} { set SELatomNUM [lindex $argv 0] set SELpropTYPE "atomic-weight" # set SELpropTYPE "density" } else { ## If 1 or 2 (valid) arguments have not supplied, ## set DEFAULTS for SELatomNUM and SELpropTYPE. set SELatomNUM 1 set SELpropTYPE "atomic-weight" # set SELpropTYPE "density" } ##+############################################ ## Select a lines in the listbox ## according to SELpropTYPE. ##+############################################ .fRright.fRatomPROPS.listbox selection set $aRpropListboxLine($SELpropTYPE) ## FOR TESTING: if {0} { puts "" puts "Additional GUI Initialization:" puts "SELpropTYPE: $SELpropTYPE" puts "aRpropListboxLine($SELpropTYPE): $aRpropListboxLine($SELpropTYPE)" puts "" } ##+################################################# ## Set some items on the GUI (like the selected-items ## text widgets at the top of the GUI) according to ## SELpropTYPE. ##+################################################# listbox_select_atomPROP ##+############################################ ## Select a line in the atomIDs listbox ## according to SELatomNUM. ##+############################################ ## NOTE: There seems to be a slight bug in the ## 'wish' interpreter in relation to ## implementation of selection lines in listboxes. ## If there is more than one listbox in a GUI, ## and you 'selection set' more than one listbox, ## only the last listbox so selected retains ## the selection. ## Hence I had to make a choice of the order in ## which to do 'selection set' in the 2 listboxes ## of this GUI. I do the atomIDs listbox last, ## so that a selected line in the atomIDs listbox ## is highlighted when the GUI starts --- rather ## than a line in the atomPROPS listbox. ##+############################################## set atomLINEnum [expr {$SELatomNUM - 1}] .fRright.fRatomIDs.listbox selection set $atomLINEnum ## FOR TESTING: if {0} { puts "" puts "Additional GUI Initialization:" puts "SELatomNUM: $SELatomNUM" puts "atomLINEnum: $atomLINEnum" puts "" } ##+################################################# ## Set some items on the GUI (like the selected-items ## text widgets at the top of the GUI) according to ## SELatomNUM. ##+################################################# listbox_select_atomID ##+########################################## ## Set the text in the text area according to ## SELatomNUM. ##+########################################## atom_props_list_update ##+############################################ ## Select background colors for the 2 listboxes ## and for the text area. ##+############################################ .fRright.fRatomIDs.listbox configure -bg "#ff0000" .fRright.fRatomPROPS.listbox configure -bg "#ffff00" .fRleft.text configure -bg "#00ff00" ##+#################################### ## Set an initial message to the user. ##+#################################### advise_user \ "** Select an atom ID (number;symbol;name) and, optionally, select a PropertyType. **"