#!/home/heller/Deepwoods/RolePlaying/bin/i386-linux/RPGwish -f
# Program: RolePlayingDB
# Tcl version: 7.3 (Tcl/Tk/XF)
# Tk version: 3.6
# XF version: $__lastrelease$
#

# module inclusion
global env
global xfLoadPath
global argv0
if {[info exists env(XF_LOAD_PATH)]} {
  if {[string first $env(XF_LOAD_PATH) .:/usr/local/lib/] == -1} {
    set xfLoadPath $env(XF_LOAD_PATH):[file dirname $argv0]:.:/usr/local/lib/
  } {
    set xfLoadPath [file dirname $argv0]:.:/usr/local/lib/
  }
} {
  set xfLoadPath [file dirname $argv0]:.:/usr/local/lib/
}

global argc
global argv
global tkVersion
global xfLoadInfo
global xfLoadPath
set xfLoadInfo 0
set tmpArgv ""
for {set counter 0} {$counter < $argc} {incr counter 1} {
  case [string tolower [lindex $argv $counter]] in {
    {-xfloadpath} {
      incr counter 1
      set xfLoadPath "[lindex $argv $counter]:$xfLoadPath"
    }
    {-xfstartup} {
      incr counter 1
      source [lindex $argv $counter]
    }
    {-xfbindfile} {
      incr counter 1
      set env(XF_BIND_FILE) "[lindex $argv $counter]"
    }
    {-xfcolorfile} {
      incr counter 1
      set env(XF_COLOR_FILE) "[lindex $argv $counter]"
    }
    {-xfcursorfile} {
      incr counter 1
      set env(XF_CURSOR_FILE) "[lindex $argv $counter]"
    }
    {-xffontfile} {
      incr counter 1
      set env(XF_FONT_FILE) "[lindex $argv $counter]"
    }
    {-xfmodelmono} {
      if {$tkVersion >= 3.0} {
        tk colormodel . monochrome
      }
    }
    {-xfmodelcolor} {
      if {$tkVersion >= 3.0} {
        tk colormodel . color
      }
    }
    {-xfloading} {
      set xfLoadInfo 1
    }
    {-xfnoloading} {
      set xfLoadInfo 0
    }
    {default} {
      lappend tmpArgv [lindex $argv $counter]
    }
  }
}
set argv $tmpArgv
set argc [llength $tmpArgv]
unset counter
unset tmpArgv


# procedure to show window .
proc ShowWindow. {args} {# xf ignore me 7

  # Window manager configurations
  global tkVersion
  wm positionfrom . user
  wm sizefrom . ""
  wm maxsize . 1024 768
  wm title . {Master: }


  # build widget .frame0
  frame .frame0 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame0.menubutton1
  menubutton .frame0.menubutton1 \
    -menu {.frame0.menubutton1.m}\
    -text {File}\
    -underline {0}

  # build widget .frame0.menubutton1.m
  menu .frame0.menubutton1.m 
  .frame0.menubutton1.m add command\
    -command {NewFrame}\
    -label {New}\
    -underline {0}
  .frame0.menubutton1.m add command\
    -command {OpenFrame}\
    -label {Open...}\
    -underline {0}
  .frame0.menubutton1.m add command\
    -command {SaveFrame}\
    -label {Save}\
    -underline {0}
  .frame0.menubutton1.m add command\
    -command {SaveFrameAs}\
    -label {Save As...}\
    -underline {5}
  .frame0.menubutton1.m add command\
    -command {PrintFrame}\
    -label {Print...}\
    -underline {0}
  .frame0.menubutton1.m add command\
    -command {Exit}\
    -label {Exit}\
    -underline {1}

  # build widget .frame0.menubutton2
  menubutton .frame0.menubutton2 \
    -menu {.frame0.menubutton2.m}\
    -text {Help}\
    -underline {0}

  # build widget .frame0.menubutton2.m
  menu .frame0.menubutton2.m 
  .frame0.menubutton2.m add command\
    -label {About}\
    -state {active}\
    -underline {0} \
    -command {PopupHelpTopic About}
  .frame0.menubutton2.m add command\
    -command {VersionAlertBox}\
    -label {Version}\
    -underline {0}
  .frame0.menubutton2.m add command\
    -label {Tutorial}\
    -underline {0} \
    -command {PopupHelpTopic Tutorial}
  .frame0.menubutton2.m add command\
    -command {AlertBoxFile "[file dirname $argv0]/Warranty.message" "" {600x350}}\
    -label {Warranty}
  .frame0.menubutton2.m add command\
    -command {AlertBoxFile "[file dirname $argv0]/copying.message" "" {600x350}}\
    -label {Copying}
  .frame0.menubutton2.m add command\
    -command {HistoryTextBox}\
    -label {History}

  # build widget .frame0.menubutton4
  menubutton .frame0.menubutton4 \
    -menu {.frame0.menubutton4.m}\
    -text {Edit}\
    -underline {0}

  # build widget .frame0.menubutton4.m
  menu .frame0.menubutton4.m 
  .frame0.menubutton4.m add command\
    -label {Undo}\
    -state {active}\
    -underline {0}
  .frame0.menubutton4.m add command\
    -label {Cut}\
    -underline {2}
  .frame0.menubutton4.m add command\
    -label {Copy}\
    -underline {0}
  .frame0.menubutton4.m add command\
    -label {Paste}\
    -underline {0}
  .frame0.menubutton4.m add command\
    -label {Clear}\
    -underline {1}
  .frame0.menubutton4.m add command\
    -label {Delete}\
    -underline {0}
  .frame0.menubutton4.m add command\
    -label {Select All}
  .frame0.menubutton4.m add command\
    -label {Deselect All}

  # build widget .frame0.menubutton5
  menubutton .frame0.menubutton5 \
    -menu {.frame0.menubutton5.m}\
    -text {View}\
    -underline {0}

  # build widget .frame0.menubutton5.m
  menu .frame0.menubutton5.m 
  .frame0.menubutton5.m add command\
    -command {PopFrame CharacterFrame}\
    -label {Character}
  .frame0.menubutton5.m add command\
    -command {PopFrame MonsterFrame}\
    -label {Monster}
  .frame0.menubutton5.m add command\
    -command {PopFrame MasterFrame}\
    -label {Master}

  # build widget .frame0.menubutton6
  menubutton .frame0.menubutton6 \
    -menu {.frame0.menubutton6.m}\
    -text {Options}\
    -underline {0}

  # build widget .frame0.menubutton6.m
  menu .frame0.menubutton6.m 

  # pack widget .frame0
  pack append .frame0 \
    .frame0.menubutton1 {left frame center} \
    .frame0.menubutton4 {left frame center} \
    .frame0.menubutton5 {left frame center} \
    .frame0.menubutton6 {left frame center} \
    .frame0.menubutton2 {right frame center} 

  # build widget .frame3
  frame .frame3 \
    -borderwidth {6}

  # build widget .frame3.frame
  frame .frame3.frame \
    -relief {raised}

  # build widget .frame3.frame.scrollbar1
  scrollbar .frame3.frame.scrollbar1 \
    -command {.frame3.frame.text2 yview}\
    -relief {raised}

  # build widget .frame3.frame.text2
  text .frame3.frame.text2 \
    -borderwidth {2}\
    -relief {raised}\
    -width {60}\
    -wrap {none}\
    -yscrollcommand {.frame3.frame.scrollbar1 set}

  # pack widget .frame3.frame
  pack append .frame3.frame \
    .frame3.frame.text2 {left frame center expand fill} \
    .frame3.frame.scrollbar1 {right frame center filly} 

  # build widget .frame3.frame0
  frame .frame3.frame0 \
    -relief {raised}

  # build widget .frame3.frame0.entry3
  entry .frame3.frame0.entry3 \
    -relief {sunken}
  # bindings
  bind .frame3.frame0.entry3 <Return> {focus [SN CharacterClass]}
  bind .frame3.frame0.entry3 <Tab> {focus [SN CharacterClass]}

  # build widget .frame3.frame0.label2
  label .frame3.frame0.label2 \
    -text {Experience Points:}

  # pack widget .frame3.frame0
  pack append .frame3.frame0 \
    .frame3.frame0.label2 {left frame w} \
    .frame3.frame0.entry3 {left frame w} 

  # build widget .frame3.frame1
  frame .frame3.frame1 \
    -relief {raised}

  # build widget .frame3.frame1.button0
  button .frame3.frame1.button0 \
    -command {set ESPercent [Dice 0]
set es [$ESPercent roll]
$ESPercent delete
[SN CharacterEStrength] delete 0 end
if {$es == 0} {
  [SN CharacterEStrength] insert end {(00)}
} else {
  [SN CharacterEStrength] insert end [format "(%02d)" $es]
}
}\
    -text {Roll Exceptional Strength}

  # build widget .frame3.frame1.button6
  button .frame3.frame1.button6 \
    -command {AdvanceCharacterLevel}\
    -text {Advance Level}

  # build widget .frame3.frame1.button8
  button .frame3.frame1.button8 \
    -command {UpdateCharacter}\
    -text {Update}

  # build widget .frame3.frame1.button9
  button .frame3.frame1.button9 \
    -command {ResetCharacterForm}\
    -text {Reset}

  # build widget .frame3.frame1.label4
  label .frame3.frame1.label4 \
    -text {Current Level:}

  # build widget .frame3.frame1.label5
  label .frame3.frame1.label5 \
    -relief {sunken}\
    -text {1}\
    -width {5}

  # pack widget .frame3.frame1
  pack append .frame3.frame1 \
    .frame3.frame1.label4 {left frame w} \
    .frame3.frame1.label5 {left frame w expand} \
    .frame3.frame1.button6 {right frame e expand} \
    .frame3.frame1.button8 {left frame center expand} \
    .frame3.frame1.button9 {left frame center expand} \
    .frame3.frame1.button0 {left frame center} 

  # build widget .frame3.frame17
  frame .frame3.frame17 \
    -borderwidth {1}

  # build widget .frame3.frame17.entry20
  entry .frame3.frame17.entry20 \
    -relief {sunken}\
    -width {39}
  # bindings
  bind .frame3.frame17.entry20 <Return> {focus [SN CharacterPlayer]}
  bind .frame3.frame17.entry20 <Tab> {focus [SN CharacterPlayer]}

  # build widget .frame3.frame17.label19
  label .frame3.frame17.label19 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Character Name:}

  # pack widget .frame3.frame17
  pack append .frame3.frame17 \
    .frame3.frame17.label19 {left frame w expand} \
    .frame3.frame17.entry20 {right frame e expand} 

  # build widget .frame3.frame18
  frame .frame3.frame18 \
    -borderwidth {1}

  # build widget .frame3.frame18.entry22
  entry .frame3.frame18.entry22 \
    -relief {sunken}\
    -width {39}
  # bindings
  bind .frame3.frame18.entry22 <Return> {focus [SN CharacterRace]}
  bind .frame3.frame18.entry22 <Tab> {focus [SN CharacterRace]}

  # build widget .frame3.frame18.label21
  label .frame3.frame18.label21 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Player Name:}

  # pack widget .frame3.frame18
  pack append .frame3.frame18 \
    .frame3.frame18.label21 {left frame w expand} \
    .frame3.frame18.entry22 {right frame e expand} 

  # build widget .frame3.frame2
  frame .frame3.frame2 \
    -borderwidth {1}

  # build widget .frame3.frame2.entry20
  entry .frame3.frame2.entry20 \
    -relief {sunken}\
    -width {39}
  # bindings
  bind .frame3.frame2.entry20 <Return> {focus [SN CharacterSex]}
  bind .frame3.frame2.entry20 <Tab> {focus [SN CharacterSex]}

  # build widget .frame3.frame2.label19
  label .frame3.frame2.label19 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Character Alignment:}

  # pack widget .frame3.frame2
  pack append .frame3.frame2 \
    .frame3.frame2.entry20 {right frame e expand} \
    .frame3.frame2.label19 {left frame w expand} 

  # build widget .frame3.frame23
  frame .frame3.frame23 \
    -borderwidth {1}

  # build widget .frame3.frame23.entry22
  entry .frame3.frame23.entry22 \
    -relief {sunken}\
    -width {39}
  # bindings
  bind .frame3.frame23.entry22 <Return> {focus [SN CharacterAlignment]}
  bind .frame3.frame23.entry22 <Tab> {focus [SN CharacterAlignment]}

  # build widget .frame3.frame23.label21
  label .frame3.frame23.label21 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Character Race:}

  # pack widget .frame3.frame23
  pack append .frame3.frame23 \
    .frame3.frame23.label21 {left frame w expand} \
    .frame3.frame23.entry22 {right frame e expand} 

  # build widget .frame3.frame24
  frame .frame3.frame24 \
    -borderwidth {2}

  # build widget .frame3.frame24.entry28
  entry .frame3.frame24.entry28 \
    -relief {sunken}
  # bindings
  bind .frame3.frame24.entry28 <Return> {focus [SN CharacterCommentary]}
  bind .frame3.frame24.entry28 <Tab> {focus [SN CharacterCommentary]}

  # build widget .frame3.frame24.label25
  label .frame3.frame24.label25 \
    -text {Hit Points:}

  # build widget .frame3.frame24.label27
  label .frame3.frame24.label27 \
    -text {Class:}

  # build widget .frame3.frame24.label7
  label .frame3.frame24.label7 \
    -relief {sunken}\
    -text {}\
    -width {5}

  # pack widget .frame3.frame24
  pack append .frame3.frame24 \
    .frame3.frame24.label25 {left frame w expand} \
    .frame3.frame24.label7 {left frame center expand} \
    .frame3.frame24.label27 {left frame center expand} \
    .frame3.frame24.entry28 {right frame e expand} 

  # build widget .frame3.frame3
  frame .frame3.frame3 \
    -borderwidth {2}

  # build widget .frame3.frame3.frame4
  frame .frame3.frame3.frame4 \
    -borderwidth {2}

  # build widget .frame3.frame3.frame4.frame5
  frame .frame3.frame3.frame4.frame5 \
    -relief {raised}

  # build widget .frame3.frame3.frame4.frame5.entry2
  entry .frame3.frame3.frame4.frame5.entry2 \
    -relief {sunken}\
    -width {10}
  # bindings
  bind .frame3.frame3.frame4.frame5.entry2 <Return> {focus [SN CharacterEStrength]}
  bind .frame3.frame3.frame4.frame5.entry2 <Tab> {focus [SN CharacterEStrength]}

  # build widget .frame3.frame3.frame4.frame5.entry3
  entry .frame3.frame3.frame4.frame5.entry3 \
    -relief {sunken}\
    -width {10}
  # bindings
  bind .frame3.frame3.frame4.frame5.entry3 <Return> {focus [SN CharacterDexterity]}
  bind .frame3.frame3.frame4.frame5.entry3 <Tab> {focus [SN CharacterDexterity]}

  # build widget .frame3.frame3.frame4.frame5.label6
  label .frame3.frame3.frame4.frame5.label6 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Strength:}

  # pack widget .frame3.frame3.frame4.frame5
  pack append .frame3.frame3.frame4.frame5 \
    .frame3.frame3.frame4.frame5.label6 {left frame w expand} \
    .frame3.frame3.frame4.frame5.entry2 {left frame e} \
    .frame3.frame3.frame4.frame5.entry3 {right frame w fillx} 

  # build widget .frame3.frame3.frame4.frame6
  frame .frame3.frame3.frame4.frame6 \
    -relief {raised}

  # build widget .frame3.frame3.frame4.frame6.entry4
  entry .frame3.frame3.frame4.frame6.entry4 \
    -relief {sunken}
  # bindings
  bind .frame3.frame3.frame4.frame6.entry4 <Return> {focus [SN CharacterChrisma]}
  bind .frame3.frame3.frame4.frame6.entry4 <Tab> {focus [SN CharacterChrisma]}

  # build widget .frame3.frame3.frame4.frame6.label1
  label .frame3.frame3.frame4.frame6.label1 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Wisdom:}

  # pack widget .frame3.frame3.frame4.frame6
  pack append .frame3.frame3.frame4.frame6 \
    .frame3.frame3.frame4.frame6.label1 {left frame w expand} \
    .frame3.frame3.frame4.frame6.entry4 {right frame e expand} 

  # build widget .frame3.frame3.frame4.frame7
  frame .frame3.frame3.frame4.frame7 \
    -relief {sunken}

  # build widget .frame3.frame3.frame4.frame7.entry3
  entry .frame3.frame3.frame4.frame7.entry3 \
    -relief {sunken}
  # bindings
  bind .frame3.frame3.frame4.frame7.entry3 <Return> {focus [SN CharacterConstitution]}
  bind .frame3.frame3.frame4.frame7.entry3 <Tab> {focus [SN CharacterConstitution]}

  # build widget .frame3.frame3.frame4.frame7.label0
  label .frame3.frame3.frame4.frame7.label0 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Intelligence:}

  # pack widget .frame3.frame3.frame4.frame7
  pack append .frame3.frame3.frame4.frame7 \
    .frame3.frame3.frame4.frame7.entry3 {right frame e expand} \
    .frame3.frame3.frame4.frame7.label0 {left frame w expand} 

  # pack widget .frame3.frame3.frame4
  pack append .frame3.frame3.frame4 \
    .frame3.frame3.frame4.frame5 {top frame w expand fillx} \
    .frame3.frame3.frame4.frame7 {top frame w expand fillx} \
    .frame3.frame3.frame4.frame6 {top frame w expand fillx} 

  # build widget .frame3.frame3.frame5
  frame .frame3.frame3.frame5 \
    -borderwidth {2}

  # build widget .frame3.frame3.frame5.frame10
  frame .frame3.frame3.frame5.frame10 \
    -relief {raised}

  # build widget .frame3.frame3.frame5.frame10.entry16
  entry .frame3.frame3.frame5.frame10.entry16 \
    -relief {sunken}
  # bindings
  bind .frame3.frame3.frame5.frame10.entry16 <Return> {focus [SN CharacterName]}
  bind .frame3.frame3.frame5.frame10.entry16 <Tab> {focus [SN CharacterName]}

  # build widget .frame3.frame3.frame5.frame10.label15
  label .frame3.frame3.frame5.frame10.label15 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Charisma:}

  # pack widget .frame3.frame3.frame5.frame10
  pack append .frame3.frame3.frame5.frame10 \
    .frame3.frame3.frame5.frame10.label15 {left frame w expand} \
    .frame3.frame3.frame5.frame10.entry16 {right frame e expand} 

  # build widget .frame3.frame3.frame5.frame8
  frame .frame3.frame3.frame5.frame8 \
    -relief {raised}

  # build widget .frame3.frame3.frame5.frame8.entry12
  entry .frame3.frame3.frame5.frame8.entry12 \
    -relief {sunken}
  # bindings
  bind .frame3.frame3.frame5.frame8.entry12 <Return> {focus [SN CharacterIntelligence]}
  bind .frame3.frame3.frame5.frame8.entry12 <Tab> {focus [SN CharacterIntelligence]}

  # build widget .frame3.frame3.frame5.frame8.label11
  label .frame3.frame3.frame5.frame8.label11 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Dexterity:}

  # pack widget .frame3.frame3.frame5.frame8
  pack append .frame3.frame3.frame5.frame8 \
    .frame3.frame3.frame5.frame8.label11 {left frame w expand} \
    .frame3.frame3.frame5.frame8.entry12 {right frame e expand} 

  # build widget .frame3.frame3.frame5.frame9
  frame .frame3.frame3.frame5.frame9 \
    -relief {raised}

  # build widget .frame3.frame3.frame5.frame9.entry14
  entry .frame3.frame3.frame5.frame9.entry14 \
    -relief {sunken}
  # bindings
  bind .frame3.frame3.frame5.frame9.entry14 <Return> {focus [SN CharacterWisdom]}
  bind .frame3.frame3.frame5.frame9.entry14 <Tab> {focus [SN CharacterWisdom]}

  # build widget .frame3.frame3.frame5.frame9.label13
  label .frame3.frame3.frame5.frame9.label13 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Constitution:}

  # pack widget .frame3.frame3.frame5.frame9
  pack append .frame3.frame3.frame5.frame9 \
    .frame3.frame3.frame5.frame9.label13 {left frame w expand} \
    .frame3.frame3.frame5.frame9.entry14 {right frame e expand} 

  # pack widget .frame3.frame3.frame5
  pack append .frame3.frame3.frame5 \
    .frame3.frame3.frame5.frame8 {top frame center expand fillx} \
    .frame3.frame3.frame5.frame9 {top frame center expand fillx} \
    .frame3.frame3.frame5.frame10 {top frame center expand fillx} 

  # pack widget .frame3.frame3
  pack append .frame3.frame3 \
    .frame3.frame3.frame4 {left frame center} \
    .frame3.frame3.frame5 {left frame center} 

  # build widget .frame3.frame5
  frame .frame3.frame5 \
    -borderwidth {1}

  # build widget .frame3.frame5.entry20
  entry .frame3.frame5.entry20 \
    -relief {sunken}\
    -width {39}
  # bindings
  bind .frame3.frame5.entry20 <Return> {focus [SN CharacterAge]}
  bind .frame3.frame5.entry20 <Tab> {focus [SN CharacterAge]}

  # build widget .frame3.frame5.label19
  label .frame3.frame5.label19 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Character Sex:}

  # pack widget .frame3.frame5
  pack append .frame3.frame5 \
    .frame3.frame5.label19 {left frame w expand} \
    .frame3.frame5.entry20 {right frame e expand} 

  # build widget .frame3.frame7
  frame .frame3.frame7 \
    -borderwidth {1}

  # build widget .frame3.frame7.entry20
  entry .frame3.frame7.entry20 \
    -relief {sunken}\
    -width {39}
  # bindings
  bind .frame3.frame7.entry20 <Return> {focus [SN CharacterExperiencePoints]}
  bind .frame3.frame7.entry20 <Tab> {focus [SN CharacterExperiencePoints]}

  # build widget .frame3.frame7.label19
  label .frame3.frame7.label19 \
    -borderwidth {0}\
    -relief {raised}\
    -text {Character Age:}

  # pack widget .frame3.frame7
  pack append .frame3.frame7 \
    .frame3.frame7.label19 {left frame w expand} \
    .frame3.frame7.entry20 {right frame e expand} 

  # build widget .frame3.label2
  label .frame3.label2 \
    -borderwidth {0}\
    -font {-Adobe-Helvetica-Bold-R-Normal--*-240-*}\
    -relief {raised}\
    -text {Character}

  # build widget .frame3.label29
  label .frame3.label29 \
    -font {-Adobe-Helvetica-Bold-R-Normal--*-180-*}\
    -text {Commentary:}

  # pack widget .frame3
  pack append .frame3 \
    .frame3.label2 {top frame center} \
    .frame3.frame3 {top frame center} \
    .frame3.frame17 {top frame center expand fillx} \
    .frame3.frame18 {top frame center expand fillx} \
    .frame3.frame23 {top frame center expand fillx} \
    .frame3.frame2 {top frame center expand fillx} \
    .frame3.frame5 {top frame center expand fillx} \
    .frame3.frame7 {top frame center expand fillx} \
    .frame3.frame0 {top frame center expand fillx} \
    .frame3.frame24 {top frame center} \
    .frame3.label29 {top frame center} \
    .frame3.frame {top frame center fill} \
    .frame3.frame1 {top frame center expand fillx} 

  # build widget .frame7
  frame .frame7 \
    -relief {raised}

  # build widget .frame7.frame
  frame .frame7.frame \
    -relief {raised}

  # build widget .frame7.frame.scrollbar1
  scrollbar .frame7.frame.scrollbar1 \
    -command {.frame7.frame.text2 yview}\
    -relief {raised}

  # build widget .frame7.frame.text2
  text .frame7.frame.text2 \
    -borderwidth {2}\
    -height {10}\
    -relief {raised}\
    -width {60}\
    -wrap {none}\
    -yscrollcommand {.frame7.frame.scrollbar1 set}

  # pack widget .frame7.frame
  pack append .frame7.frame \
    .frame7.frame.scrollbar1 {right frame center filly} \
    .frame7.frame.text2 {top frame center expand fill} 

  # build widget .frame7.frame0
  frame .frame7.frame0 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame0
  frame .frame7.frame0.frame0 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame0.entry2
  entry .frame7.frame0.frame0.entry2 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame0.entry2 <Return> {focus [SN MonsterFrequency]}
  bind .frame7.frame0.frame0.entry2 <Tab> {focus [SN MonsterFrequency]}

  # build widget .frame7.frame0.frame0.label1
  label .frame7.frame0.frame0.label1 \
    -text {Name or Type:}

  # pack widget .frame7.frame0.frame0
  pack append .frame7.frame0.frame0 \
    .frame7.frame0.frame0.label1 {left frame w} \
    .frame7.frame0.frame0.entry2 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame2
  frame .frame7.frame0.frame2 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame2.entry19
  entry .frame7.frame0.frame2.entry19 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame2.entry19 <Return> {focus [SN MonsterNoAppearing]}
  bind .frame7.frame0.frame2.entry19 <Tab> {focus [SN MonsterNoAppearing]}

  # build widget .frame7.frame0.frame2.label18
  label .frame7.frame0.frame2.label18 \
    -text {Frequency: }

  # pack widget .frame7.frame0.frame2
  pack append .frame7.frame0.frame2 \
    .frame7.frame0.frame2.label18 {left frame w} \
    .frame7.frame0.frame2.entry19 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame24
  frame .frame7.frame0.frame24 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame24.entry23
  entry .frame7.frame0.frame24.entry23 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame24.entry23 <Return> {
    global MonsterHitType
    if {$MonsterHitType == {HitPoints}} {
      focus [SN MonsterHitPoints]
    } else {
      focus [SN MonsterHitDiceND]
    }}
  bind .frame7.frame0.frame24.entry23 <Tab> {
    global MonsterHitType
    if {$MonsterHitType == {HitPoints}} {
      focus [SN MonsterHitPoints]
    } else {
      focus [SN MonsterHitDiceND]
    }}

  # build widget .frame7.frame0.frame24.label22
  label .frame7.frame0.frame24.label22 \
    -text {Move:}

  # pack widget .frame7.frame0.frame24
  pack append .frame7.frame0.frame24 \
    .frame7.frame0.frame24.label22 {left frame w} \
    .frame7.frame0.frame24.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame25
  frame .frame7.frame0.frame25 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame25.entry23
  entry .frame7.frame0.frame25.entry23 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame25.entry23 <Return> {focus [SN MonsterTreasureType]}
  bind .frame7.frame0.frame25.entry23 <Tab> {focus [SN MonsterTreasureType]}

  # build widget .frame7.frame0.frame25.label22
  label .frame7.frame0.frame25.label22 \
    -text {% in lair:}

  # pack widget .frame7.frame0.frame25
  pack append .frame7.frame0.frame25 \
    .frame7.frame0.frame25.label22 {left frame w} \
    .frame7.frame0.frame25.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame26
  frame .frame7.frame0.frame26 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame26.frame27
  frame .frame7.frame0.frame26.frame27 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame26.frame27.entry30
  entry .frame7.frame0.frame26.frame27.entry30 \
    -relief {sunken}\
    -width {1}
  # bindings
  bind .frame7.frame0.frame26.frame27.entry30 <Return> {focus [SN MonsterHitDiceNS]}
  bind .frame7.frame0.frame26.frame27.entry30 <Tab> {focus [SN MonsterHitDiceNS]}

  # build widget .frame7.frame0.frame26.frame27.entry32
  entry .frame7.frame0.frame26.frame27.entry32 \
    -relief {sunken}\
    -width {1}
  # bindings
  bind .frame7.frame0.frame26.frame27.entry32 <Return> {focus [SN MonsterPercentInLair]}
  bind .frame7.frame0.frame26.frame27.entry32 <Tab> {focus [SN MonsterPercentInLair]}

  # build widget .frame7.frame0.frame26.frame27.label31
  label .frame7.frame0.frame26.frame27.label31 \
    -text {d}

  # build widget .frame7.frame0.frame26.frame27.radiobutton29
  radiobutton .frame7.frame0.frame26.frame27.radiobutton29 \
    -text {HitDice}\
    -value {HitDice}\
    -variable {MonsterHitType}

  # pack widget .frame7.frame0.frame26.frame27
  pack append .frame7.frame0.frame26.frame27 \
    .frame7.frame0.frame26.frame27.radiobutton29 {left frame center} \
    .frame7.frame0.frame26.frame27.entry30 {left frame center} \
    .frame7.frame0.frame26.frame27.label31 {left frame center} \
    .frame7.frame0.frame26.frame27.entry32 {left frame center} 

  # build widget .frame7.frame0.frame26.frame28
  frame .frame7.frame0.frame26.frame28 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame26.frame28.entry34
  entry .frame7.frame0.frame26.frame28.entry34 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame26.frame28.entry34 <Return> {focus [SN MonsterPercentInLair]}
  bind .frame7.frame0.frame26.frame28.entry34 <Tab> {focus [SN MonsterPercentInLair]}

  # build widget .frame7.frame0.frame26.frame28.radiobutton33
  radiobutton .frame7.frame0.frame26.frame28.radiobutton33 \
    -text {HitPoints}\
    -value {HitPoints}\
    -variable {MonsterHitType}

  # pack widget .frame7.frame0.frame26.frame28
  pack append .frame7.frame0.frame26.frame28 \
    .frame7.frame0.frame26.frame28.radiobutton33 {left frame center} \
    .frame7.frame0.frame26.frame28.entry34 {right frame center expand fillx} 

  # pack widget .frame7.frame0.frame26
  pack append .frame7.frame0.frame26 \
    .frame7.frame0.frame26.frame27 {left frame center} \
    .frame7.frame0.frame26.frame28 {right frame center expand fillx} 

  # build widget .frame7.frame0.frame3
  frame .frame7.frame0.frame3 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame3.entry21
  entry .frame7.frame0.frame3.entry21 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame3.entry21 <Return> {focus [SN MonsterArmorClass]}
  bind .frame7.frame0.frame3.entry21 <Tab> {focus [SN MonsterArmorClass]}

  # build widget .frame7.frame0.frame3.label20
  label .frame7.frame0.frame3.label20 \
    -text {No. Appearing:}

  # pack widget .frame7.frame0.frame3
  pack append .frame7.frame0.frame3 \
    .frame7.frame0.frame3.label20 {left frame w} \
    .frame7.frame0.frame3.entry21 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame35
  frame .frame7.frame0.frame35 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame35.entry23
  entry .frame7.frame0.frame35.entry23 \
    -relief {sunken}\
    -width {30}
  # bindings
  bind .frame7.frame0.frame35.entry23 <Return> {focus [SN MonsterNoAttacks]}
  bind .frame7.frame0.frame35.entry23 <Tab> {focus [SN MonsterNoAttacks]}

  # build widget .frame7.frame0.frame35.label22
  label .frame7.frame0.frame35.label22 \
    -text {Treasure Type:}

  # pack widget .frame7.frame0.frame35
  pack append .frame7.frame0.frame35 \
    .frame7.frame0.frame35.label22 {left frame w} \
    .frame7.frame0.frame35.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame36
  frame .frame7.frame0.frame36 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame36.entry23
  entry .frame7.frame0.frame36.entry23 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame36.entry23 <Return> {focus [SN MonsterDamPerAttack]}
  bind .frame7.frame0.frame36.entry23 <Tab> {focus [SN MonsterDamPerAttack]}

  # build widget .frame7.frame0.frame36.label22
  label .frame7.frame0.frame36.label22 \
    -text {Number Of Attacks:}

  # pack widget .frame7.frame0.frame36
  pack append .frame7.frame0.frame36 \
    .frame7.frame0.frame36.label22 {left frame w} \
    .frame7.frame0.frame36.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame37
  frame .frame7.frame0.frame37 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame37.entry23
  entry .frame7.frame0.frame37.entry23 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame37.entry23 <Return> {focus [SN MonsterSpecialAttacks]}
  bind .frame7.frame0.frame37.entry23 <Tab> {focus [SN MonsterSpecialAttacks]}

  # build widget .frame7.frame0.frame37.label22
  label .frame7.frame0.frame37.label22 \
    -text {Damage per Attack:}

  # pack widget .frame7.frame0.frame37
  pack append .frame7.frame0.frame37 \
    .frame7.frame0.frame37.label22 {left frame w} \
    .frame7.frame0.frame37.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame38
  frame .frame7.frame0.frame38 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame38.entry23
  entry .frame7.frame0.frame38.entry23 \
    -relief {sunken}\
    -width {42}
  # bindings
  bind .frame7.frame0.frame38.entry23 <Return> {focus [SN MonsterSpecialDefences]}
  bind .frame7.frame0.frame38.entry23 <Tab> {focus [SN MonsterSpecialDefences]}

  # build widget .frame7.frame0.frame38.label22
  label .frame7.frame0.frame38.label22 \
    -text {Special Attacks:}

  # pack widget .frame7.frame0.frame38
  pack append .frame7.frame0.frame38 \
    .frame7.frame0.frame38.label22 {left frame w} \
    .frame7.frame0.frame38.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame39
  frame .frame7.frame0.frame39 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame39.entry23
  entry .frame7.frame0.frame39.entry23 \
    -relief {sunken}\
    -width {39}
  # bindings
  bind .frame7.frame0.frame39.entry23 <Return> {focus [SN MonsterMagicResistance]}
  bind .frame7.frame0.frame39.entry23 <Tab> {focus [SN MonsterMagicResistance]}

  # build widget .frame7.frame0.frame39.label22
  label .frame7.frame0.frame39.label22 \
    -text {Special Defences:}

  # pack widget .frame7.frame0.frame39
  pack append .frame7.frame0.frame39 \
    .frame7.frame0.frame39.label22 {left frame w} \
    .frame7.frame0.frame39.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame4
  frame .frame7.frame0.frame4 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame4.entry23
  entry .frame7.frame0.frame4.entry23 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame4.entry23 <Return> {focus [SN MonsterMove]}
  bind .frame7.frame0.frame4.entry23 <Tab> {focus [SN MonsterMove]}

  # build widget .frame7.frame0.frame4.label22
  label .frame7.frame0.frame4.label22 \
    -text {Armor Class:}

  # pack widget .frame7.frame0.frame4
  pack append .frame7.frame0.frame4 \
    .frame7.frame0.frame4.label22 {left frame w} \
    .frame7.frame0.frame4.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame40
  frame .frame7.frame0.frame40 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame40.entry23
  entry .frame7.frame0.frame40.entry23 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame40.entry23 <Return> {focus [SN MonsterIntelligence]}
  bind .frame7.frame0.frame40.entry23 <Tab> {focus [SN MonsterIntelligence]}

  # build widget .frame7.frame0.frame40.label22
  label .frame7.frame0.frame40.label22 \
    -text {Magic Resistance:}

  # pack widget .frame7.frame0.frame40
  pack append .frame7.frame0.frame40 \
    .frame7.frame0.frame40.label22 {left frame w} \
    .frame7.frame0.frame40.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame41
  frame .frame7.frame0.frame41 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame41.entry23
  entry .frame7.frame0.frame41.entry23 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame41.entry23 <Return> {focus [SN MonsterAlignment]}
  bind .frame7.frame0.frame41.entry23 <Tab> {focus [SN MonsterAlignment]}

  # build widget .frame7.frame0.frame41.label22
  label .frame7.frame0.frame41.label22 \
    -text {Intelligence:}

  # pack widget .frame7.frame0.frame41
  pack append .frame7.frame0.frame41 \
    .frame7.frame0.frame41.label22 {left frame w} \
    .frame7.frame0.frame41.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame42
  frame .frame7.frame0.frame42 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame42.entry23
  entry .frame7.frame0.frame42.entry23 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame42.entry23 <Return> {focus [SN MonsterSize]}
  bind .frame7.frame0.frame42.entry23 <Tab> {focus [SN MonsterSize]}

  # build widget .frame7.frame0.frame42.label22
  label .frame7.frame0.frame42.label22 \
    -text {Alignment:}

  # pack widget .frame7.frame0.frame42
  pack append .frame7.frame0.frame42 \
    .frame7.frame0.frame42.label22 {left frame w} \
    .frame7.frame0.frame42.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame43
  frame .frame7.frame0.frame43 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame43.entry23
  entry .frame7.frame0.frame43.entry23 \
    -relief {sunken}
  # bindings
  bind .frame7.frame0.frame43.entry23 <Return> {focus [SN MonsterPsionicAbility]}
  bind .frame7.frame0.frame43.entry23 <Tab> {focus [SN MonsterPsionicAbility]}

  # build widget .frame7.frame0.frame43.label22
  label .frame7.frame0.frame43.label22 \
    -text {Size:}

  # pack widget .frame7.frame0.frame43
  pack append .frame7.frame0.frame43 \
    .frame7.frame0.frame43.label22 {left frame w} \
    .frame7.frame0.frame43.entry23 {left frame w expand fillx} 

  # build widget .frame7.frame0.frame44
  frame .frame7.frame0.frame44 \
    -borderwidth {2}

  # build widget .frame7.frame0.frame44.entry23
  entry .frame7.frame0.frame44.entry23 \
    -relief {sunken}\
    -width {40}
  # bindings
  bind .frame7.frame0.frame44.entry23 <Return> {focus [SN MonsterComments]}
  bind .frame7.frame0.frame44.entry23 <Tab> {focus [SN MonsterComments]}

  # build widget .frame7.frame0.frame44.label22
  label .frame7.frame0.frame44.label22 \
    -text {Psionic Ability:}

  # pack widget .frame7.frame0.frame44
  pack append .frame7.frame0.frame44 \
    .frame7.frame0.frame44.label22 {left frame w} \
    .frame7.frame0.frame44.entry23 {left frame w expand fillx} 

  # pack widget .frame7.frame0
  pack append .frame7.frame0 \
    .frame7.frame0.frame0 {top frame center expand fillx} \
    .frame7.frame0.frame2 {top frame center expand fillx} \
    .frame7.frame0.frame3 {top frame center expand fillx} \
    .frame7.frame0.frame4 {top frame center expand fillx} \
    .frame7.frame0.frame24 {top frame center expand fillx} \
    .frame7.frame0.frame26 {top frame center expand fillx} \
    .frame7.frame0.frame25 {top frame center expand fillx} \
    .frame7.frame0.frame35 {top frame center expand fillx} \
    .frame7.frame0.frame36 {top frame center expand fillx} \
    .frame7.frame0.frame37 {top frame center expand fillx} \
    .frame7.frame0.frame38 {top frame center expand fillx} \
    .frame7.frame0.frame39 {top frame center expand fillx} \
    .frame7.frame0.frame40 {top frame center expand fillx} \
    .frame7.frame0.frame41 {top frame center expand fillx} \
    .frame7.frame0.frame42 {top frame center expand fillx} \
    .frame7.frame0.frame43 {top frame center expand fillx} \
    .frame7.frame0.frame44 {top frame center expand fillx} 

  # build widget .frame7.frame46
  frame .frame7.frame46 \
    -borderwidth {2}

  # build widget .frame7.frame46.button47
  button .frame7.frame46.button47 \
    -command {UpdateMonster}\
    -text {Update}

  # build widget .frame7.frame46.button48
  button .frame7.frame46.button48 \
    -command {ResetMonsterForm}\
    -text {Reset}

  # pack widget .frame7.frame46
  pack append .frame7.frame46 \
    .frame7.frame46.button47 {left frame center expand} \
    .frame7.frame46.button48 {right frame center expand} 

  # build widget .frame7.label1
  label .frame7.label1 \
    -borderwidth {0}\
    -font {-Adobe-Helvetica-Bold-R-Normal--*-240-*}\
    -relief {raised}\
    -text {Monster}

  # build widget .frame7.label45
  label .frame7.label45 \
    -font {-Adobe-Helvetica-Bold-R-Normal--*-180-*}\
    -text {Commentary:}

  # pack widget .frame7
  pack append .frame7 \
    .frame7.label1 {top frame center} \
    .frame7.frame0 {top frame center expand fillx} \
    .frame7.label45 {top frame center} \
    .frame7.frame {top frame center fill} \
    .frame7.frame46 {top frame center fillx} 

  # build widget .frame8
  frame .frame8 \
    -borderwidth {2}

  # build widget .frame8.frame1
  frame .frame8.frame1 

  # build widget .frame8.frame1.radiobutton0
  radiobutton .frame8.frame1.radiobutton0 \
    -command {MasterSubSubModeChange Melee}\
    -state {disabled}\
    -text {Melee}\
    -value {Melee}\
    -variable {MasterSubSubMode}

  # build widget .frame8.frame1.radiobutton1
  radiobutton .frame8.frame1.radiobutton1 \
    -command {MasterSubSubModeChange Create}\
    -state {disabled}\
    -text {Create Treasure/Trick}\
    -value {Create}\
    -variable {MasterSubSubMode}

  # build widget .frame8.frame1.radiobutton2
  radiobutton .frame8.frame1.radiobutton2 \
    -command {MasterSubSubModeChange Monsters}\
    -state {disabled}\
    -text {Monsters}\
    -value {Monsters}\
    -variable {MasterSubSubMode}

  # build widget .frame8.frame1.radiobutton3
  radiobutton .frame8.frame1.radiobutton3 \
    -command {MasterChangeMode Build}\
    -text {Build}\
    -value {Build}\
    -variable {MasterMode}

  # build widget .frame8.frame1.radiobutton4
  radiobutton .frame8.frame1.radiobutton4 \
    -command {MasterChangeMode Play}\
    -state {disabled}\
    -text {Play}\
    -value {Play}\
    -variable {MasterMode}

  # build widget .frame8.frame1.radiobutton5
  radiobutton .frame8.frame1.radiobutton5 \
    -command {MasterSubSubModeChange Tricks}\
    -state {disabled}\
    -text {Tricks}\
    -value {Tricks}\
    -variable {MasterSubSubMode}

  # build widget .frame8.frame1.radiobutton7
  radiobutton .frame8.frame1.radiobutton7 \
    -command {MasterSubSubModeChange Treasure}\
    -state {disabled}\
    -text {Treasure}\
    -value {Treasure}\
    -variable {MasterSubSubMode}

  # build widget .frame8.frame1.radiobutton8
  radiobutton .frame8.frame1.radiobutton8 \
    -command {MasterSubSubModeChange Other}\
    -state {disabled}\
    -text {Other}\
    -value {Other}\
    -variable {MasterSubSubMode}

  # build widget .frame8.frame1.radiobutton9
  radiobutton .frame8.frame1.radiobutton9 \
   -command {MasterSubSubModeChange Exits}\
   -state {disabled}\
   -text {Exits}\
   -value {Exits}\
   -variable {MasterSubSubMode}

  # pack widget .frame8.frame1
  pack append .frame8.frame1 \
    .frame8.frame1.radiobutton3 {left frame center expand fillx} \
    .frame8.frame1.radiobutton4 {left frame center expand fillx} \
    .frame8.frame1.radiobutton2 {left frame center expand fillx} \
    .frame8.frame1.radiobutton5 {left frame center expand fillx} \
    .frame8.frame1.radiobutton7 {left frame center expand fillx} \
    .frame8.frame1.radiobutton8 {left frame center expand fillx} \
    .frame8.frame1.radiobutton0 {left frame center expand fillx} \
    .frame8.frame1.radiobutton1 {left frame center expand fillx} \
    .frame8.frame1.radiobutton9 {left frame center expand fillx}

  # build widget .frame8.frame16
  frame .frame8.frame16 \
    -borderwidth {2}

  # build widget .frame8.frame16.frame0
  frame .frame8.frame16.frame0 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame16.frame0.scrollbar1
  scrollbar .frame8.frame16.frame0.scrollbar1 \
    -command {.frame8.frame16.frame0.canvas2 yview}\
    -relief {raised}

  # build widget .frame8.frame16.frame0.scrollbar3
  scrollbar .frame8.frame16.frame0.scrollbar3 \
    -command {.frame8.frame16.frame0.canvas2 xview}\
    -orient {horizontal}\
    -relief {raised}

  # build widget .frame8.frame16.frame0.canvas2
  canvas .frame8.frame16.frame0.canvas2 \
    -height {200}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -relief {raised}\
    -scrollregion {0 0 150 300}\
    -selectborderwidth {2}\
    -width {102}\
    -xscrollcommand {.frame8.frame16.frame0.scrollbar3 set}\
    -yscrollcommand {.frame8.frame16.frame0.scrollbar1 set}
  # build canvas items .frame8.frame16.frame0.canvas2
  # bindings
  bind .frame8.frame16.frame0.canvas2 <B1-Motion> {MoveDrag %W %x %y}
  bind .frame8.frame16.frame0.canvas2 <Button-1> {MoveStart %W %x %y [CheckMasterMode Play]}
  bind .frame8.frame16.frame0.canvas2 <Button-3> {DescribeBitMap %W %x %y}
  bind .frame8.frame16.frame0.canvas2 <ButtonRelease-1> {MoveEnd %W}

  # pack widget .frame8.frame16.frame0
  pack append .frame8.frame16.frame0 \
    .frame8.frame16.frame0.scrollbar1 {right frame center filly} \
    .frame8.frame16.frame0.canvas2 {top frame center expand fill} \
    .frame8.frame16.frame0.scrollbar3 {top frame center fillx} 

  # build widget .frame8.frame16.frame1
  frame .frame8.frame16.frame1 \
    -relief {raised}

  # build widget .frame8.frame16.frame1.scrollbar1
  scrollbar .frame8.frame16.frame1.scrollbar1 \
    -command {.frame8.frame16.frame1.canvas2 yview}\
    -relief {raised}

  # build widget .frame8.frame16.frame1.scrollbar3
  scrollbar .frame8.frame16.frame1.scrollbar3 \
    -command {.frame8.frame16.frame1.canvas2 xview}\
    -orient {horizontal}\
    -relief {raised}

  # build widget .frame8.frame16.frame1.canvas2
  canvas .frame8.frame16.frame1.canvas2 \
    -height {207}\
    -insertofftime {600}\
    -relief {raised}\
    -scrollregion {0 0 0 0}\
    -width {296}\
    -xscrollcommand {.frame8.frame16.frame1.scrollbar3 set}\
    -yscrollcommand {.frame8.frame16.frame1.scrollbar1 set}
  # build canvas items .frame8.frame16.frame1.canvas2
  # bindings
  CLBind .frame8.frame16.frame1.canvas2

  # pack widget .frame8.frame16.frame1
  pack append .frame8.frame16.frame1 \
    .frame8.frame16.frame1.scrollbar1 {right frame center filly} \
    .frame8.frame16.frame1.canvas2 {top frame center expand fill} \
    .frame8.frame16.frame1.scrollbar3 {top frame center fillx} 

  # build widget .frame8.frame16.frame2
  frame .frame8.frame16.frame2 

  # build widget .frame8.frame16.frame2.frame12
  frame .frame8.frame16.frame2.frame12 \
    -borderwidth {2}

  # build widget .frame8.frame16.frame2.frame12.button1
  button .frame8.frame16.frame2.frame12.button1 \
    -command {MasterAddCharacter}\
    -state {disabled}\
    -text {Add Character}

  # build widget .frame8.frame16.frame2.frame12.button13
  button .frame8.frame16.frame2.frame12.button13 \
    -command {MasterViewCharacter}\
    -text {View Character}

  # build widget .frame8.frame16.frame2.frame12.button2
  button .frame8.frame16.frame2.frame12.button2 \
    -command {MasterRemoveCharacter}\
    -state {disabled}\
    -text {Remove Character}

  # build widget .frame8.frame16.frame2.frame12.button14
  button .frame8.frame16.frame2.frame12.button14 \
    -command {MasterAddEncumbrence}\
    -state {disabled}\
    -text {Add Encumbrence}

  # build widget .frame8.frame16.frame2.frame12.button15
  button .frame8.frame16.frame2.frame12.button15 \
    -command {MasterRemoveEncumbrence}\
    -state {disabled}\
    -text {Remove Encumbrence}

  # build widget .frame8.frame16.frame2.frame12.button16
  button .frame8.frame16.frame2.frame12.button16 \
    -command {MasterListEncumbrences}\
    -state {disabled}\
    -text {List Encumbrences}

  # pack widget .frame8.frame16.frame2.frame12
  pack append .frame8.frame16.frame2.frame12 \
    .frame8.frame16.frame2.frame12.button13 {top frame center fillx} \
    .frame8.frame16.frame2.frame12.button1 {top frame center fillx} \
    .frame8.frame16.frame2.frame12.button2 {top frame center fillx} \
    .frame8.frame16.frame2.frame12.button14 {top frame center fillx} \
    .frame8.frame16.frame2.frame12.button15 {top frame center fillx} \
    .frame8.frame16.frame2.frame12.button16 {top frame center fillx}
    

  # build widget .frame8.frame16.frame2.frame17
  frame .frame8.frame16.frame2.frame17 

  # build widget .frame8.frame16.frame2.frame17.frame18
  frame .frame8.frame16.frame2.frame17.frame18 

  # build widget .frame8.frame16.frame2.frame17.frame18.button21
  button .frame8.frame16.frame2.frame17.frame18.button21 \
    -bitmap {UpLeft}\
    -command {UpLeft}\
    -text {}

  # build widget .frame8.frame16.frame2.frame17.frame18.button22
  button .frame8.frame16.frame2.frame17.frame18.button22 \
    -bitmap {Up}\
    -command {Up}\
    -text {}

  # build widget .frame8.frame16.frame2.frame17.frame18.button23
  button .frame8.frame16.frame2.frame17.frame18.button23 \
    -bitmap {UpRight}\
    -command {UpRight}\
    -text {}

  # pack widget .frame8.frame16.frame2.frame17.frame18
  pack append .frame8.frame16.frame2.frame17.frame18 \
    .frame8.frame16.frame2.frame17.frame18.button21 {left frame center fill} \
    .frame8.frame16.frame2.frame17.frame18.button22 {left frame center fill} \
    .frame8.frame16.frame2.frame17.frame18.button23 {left frame center fill} 

  # build widget .frame8.frame16.frame2.frame17.frame19
  frame .frame8.frame16.frame2.frame17.frame19 

  # build widget .frame8.frame16.frame2.frame17.frame19.button24
  button .frame8.frame16.frame2.frame17.frame19.button24 \
    -bitmap {Left}\
    -command {Left}\
    -text {}

  # build widget .frame8.frame16.frame2.frame17.frame19.button25
  menubutton .frame8.frame16.frame2.frame17.frame19.menubutton25 \
    -bitmap {Center}\
    -text {}\
    -relief {raised} \
    -menu {.frame8.frame16.frame2.frame17.frame19.menubutton25.m}

  # build widget .frame8.frame16.frame2.frame17.frame19.menubutton25.m
  menu .frame8.frame16.frame2.frame17.frame19.menubutton25.m
  .frame8.frame16.frame2.frame17.frame19.menubutton25.m add command\
    -command {Center Up}\
    -label {Up}
  .frame8.frame16.frame2.frame17.frame19.menubutton25.m add command\
    -command {Center Down}\
    -label {Down}

  # build widget .frame8.frame16.frame2.frame17.frame19.button26
  button .frame8.frame16.frame2.frame17.frame19.button26 \
    -bitmap {Right}\
    -command {Right}\
    -text {}

  # pack widget .frame8.frame16.frame2.frame17.frame19
  pack append .frame8.frame16.frame2.frame17.frame19 \
    .frame8.frame16.frame2.frame17.frame19.button24 {left frame center fill} \
    .frame8.frame16.frame2.frame17.frame19.menubutton25 {left frame center fill} \
    .frame8.frame16.frame2.frame17.frame19.button26 {left frame center fill} 

  # build widget .frame8.frame16.frame2.frame17.frame20
  frame .frame8.frame16.frame2.frame17.frame20 

  # build widget .frame8.frame16.frame2.frame17.frame20.button27
  button .frame8.frame16.frame2.frame17.frame20.button27 \
    -bitmap {DownLeft}\
    -command {DownLeft}\
    -text {}

  # build widget .frame8.frame16.frame2.frame17.frame20.button28
  button .frame8.frame16.frame2.frame17.frame20.button28 \
    -bitmap {Down}\
    -command {Down}\
    -text {}

  # build widget .frame8.frame16.frame2.frame17.frame20.button29
  button .frame8.frame16.frame2.frame17.frame20.button29 \
    -bitmap {DownRight}\
    -command {DownRight}\
    -text {}

  # pack widget .frame8.frame16.frame2.frame17.frame20
  pack append .frame8.frame16.frame2.frame17.frame20 \
    .frame8.frame16.frame2.frame17.frame20.button27 {left frame center fill} \
    .frame8.frame16.frame2.frame17.frame20.button28 {left frame center fill} \
    .frame8.frame16.frame2.frame17.frame20.button29 {left frame center fill} 

  # pack widget .frame8.frame16.frame2.frame17
  pack append .frame8.frame16.frame2.frame17 \
    .frame8.frame16.frame2.frame17.frame18 {top frame center expand fill} \
    .frame8.frame16.frame2.frame17.frame19 {top frame center expand fill} \
    .frame8.frame16.frame2.frame17.frame20 {top frame center expand fill} 

  # pack widget .frame8.frame16.frame2
  pack append .frame8.frame16.frame2 \
    .frame8.frame16.frame2.frame17 {top frame center expand} \
    .frame8.frame16.frame2.frame12 {top frame center expand} 

  # pack widget .frame8.frame16
  pack append .frame8.frame16 \
    .frame8.frame16.frame2 {left frame center filly} \
    .frame8.frame16.frame0 {left frame center filly} \
    .frame8.frame16.frame1 {left frame center expand fill} 

  # build widget .frame8.frame3
  frame .frame8.frame3 

  # build widget .frame8.frame3.button5
  button .frame8.frame3.button5 \
    -command {MasterGoto}\
    -text {Goto: }

  # build widget .frame8.frame3.entry6
  entry .frame8.frame3.entry6 \
    -relief {sunken}\
    -width {3}
  # bindings
  bind .frame8.frame3.entry6 <Return> {focus [SN MasterLocationX]}
  bind .frame8.frame3.entry6 <Tab> {focus [SN MasterLocationX]}

  # build widget .frame8.frame3.entry7
  entry .frame8.frame3.entry7 \
    -relief {sunken}\
    -width {3}
  # bindings
  bind .frame8.frame3.entry7 <Return> {focus [SN MasterLocationY]}
  bind .frame8.frame3.entry7 <Tab> {focus [SN MasterLocationY]}

  # build widget .frame8.frame3.entry8
  entry .frame8.frame3.entry8 \
    -relief {sunken}\
    -width {3}
  # bindings
  bind .frame8.frame3.entry8 <Tab> {focus [SN MasterLocationLevel]}
  bind .frame8.frame3.entry8 <Return> {MasterGoto}

  # build widget .frame8.frame3.label10
  label .frame8.frame3.label10 \
    -text {X:}

  # build widget .frame8.frame3.label11
  label .frame8.frame3.label11 \
    -text {Y:}

  # build widget .frame8.frame3.label9
  label .frame8.frame3.label9 \
    -text {Level:}

  # pack widget .frame8.frame3
  pack append .frame8.frame3 \
    .frame8.frame3.button5 {left frame center expand} \
    .frame8.frame3.label9 {left frame center expand} \
    .frame8.frame3.entry6 {left frame center} \
    .frame8.frame3.label10 {left frame center} \
    .frame8.frame3.entry7 {left frame center} \
    .frame8.frame3.label11 {left frame center} \
    .frame8.frame3.entry8 {left frame center fillx} 

  # build widget .frame8.frame4
  frame .frame8.frame4 

  # build widget .frame8.frame4.frame0
  frame .frame8.frame4.frame0 

  # build widget .frame8.frame4.frame0.frame
  frame .frame8.frame4.frame0.frame \
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame.scrollbar1
  scrollbar .frame8.frame4.frame0.frame.scrollbar1 \
    -command {.frame8.frame4.frame0.frame.text2 yview}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame.text2
  text .frame8.frame4.frame0.frame.text2 \
    -borderwidth {2}\
    -height {9}\
    -relief {sunken}\
    -width {60}\
    -wrap {word}\
    -yscrollcommand {.frame8.frame4.frame0.frame.scrollbar1 set}

  # pack widget .frame8.frame4.frame0.frame
  pack append .frame8.frame4.frame0.frame \
    .frame8.frame4.frame0.frame.scrollbar1 {right frame center filly} \
    .frame8.frame4.frame0.frame.text2 {top frame center expand fill} 

  # build widget .frame8.frame4.frame0.frame1
  frame .frame8.frame4.frame0.frame1

  # build widget .frame8.frame4.frame0.frame1.frame1
  frame .frame8.frame4.frame0.frame1.frame1 

  # build widget .frame8.frame4.frame0.frame1.frame1.frame0
  frame .frame8.frame4.frame0.frame1.frame1.frame0 \
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame0.scrollbar1
  scrollbar .frame8.frame4.frame0.frame1.frame1.frame0.scrollbar1 \
    -command {.frame8.frame4.frame0.frame1.frame1.frame0.canvas2 yview}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame0.scrollbar3
  scrollbar .frame8.frame4.frame0.frame1.frame1.frame0.scrollbar3 \
    -command {.frame8.frame4.frame0.frame1.frame1.frame0.canvas2 xview}\
    -orient {horizontal}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame0.canvas2
  canvas .frame8.frame4.frame0.frame1.frame1.frame0.canvas2 \
    -height {148}\
    -insertofftime {600}\
    -relief {raised}\
    -scrollregion {0 0 0 0}\
    -width {275}\
    -xscrollcommand {.frame8.frame4.frame0.frame1.frame1.frame0.scrollbar3 set}\
    -yscrollcommand {.frame8.frame4.frame0.frame1.frame1.frame0.scrollbar1 set}
  # build canvas items .frame8.frame4.frame0.frame1.frame1.frame0.canvas2
  # bindings
  CLBind .frame8.frame4.frame0.frame1.frame1.frame0.canvas2

  # pack widget .frame8.frame4.frame0.frame1.frame1.frame0
  pack append .frame8.frame4.frame0.frame1.frame1.frame0 \
    .frame8.frame4.frame0.frame1.frame1.frame0.scrollbar1 {right frame center filly} \
    .frame8.frame4.frame0.frame1.frame1.frame0.canvas2 {top frame center expand fill} \
    .frame8.frame4.frame0.frame1.frame1.frame0.scrollbar3 {top frame center fillx} 

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2
  frame .frame8.frame4.frame0.frame1.frame1.frame2 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.button14
  button .frame8.frame4.frame0.frame1.frame1.frame2.button14 \
    -command {MasterAddCombatant}\
    -text {Add Combatant}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.button3
  button .frame8.frame4.frame0.frame1.frame1.frame2.button3 \
    -command {MasterSelectAttacker}\
    -text {Select Attacker}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.button4
  button .frame8.frame4.frame0.frame1.frame1.frame2.button4 \
    -command {MasterSelectDefender}\
    -text {Select Defender}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame10
  frame .frame8.frame4.frame0.frame1.frame1.frame2.frame10 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame10.button6
  button .frame8.frame4.frame0.frame1.frame1.frame2.frame10.button6 \
    -command {MasterMeleeDamage}\
    -text {Damage}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry7
  entry .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry7 \
    -relief {sunken}\
    -width {1}
  # bindings
  bind .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry7 <Return> {focus [SN MasterMeleeDamageNS]}
  bind .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry7 <Tab> {focus [SN MasterMeleeDamageNS]}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry9
  entry .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry9 \
    -relief {sunken}\
    -width {2}
  # bindings
  bind .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry9 <Return> {MasterMeleeDamage}
  bind .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry9 <Tab> {focus [SN MasterMeleeHitND]}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame10.label8
  label .frame8.frame4.frame0.frame1.frame1.frame2.frame10.label8 \
    -text {d}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame10.label9
  label .frame8.frame4.frame0.frame1.frame1.frame2.frame10.label9 \
    -text {}\
    -relief {sunken}\
    -width 5

  # pack widget .frame8.frame4.frame0.frame1.frame1.frame2.frame10
  pack append .frame8.frame4.frame0.frame1.frame1.frame2.frame10 \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame10.button6 {left frame center} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry7 {left frame center} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame10.label8 {left frame center} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry9 {left frame center} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame10.label9 {left frame center}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame11
  frame .frame8.frame4.frame0.frame1.frame1.frame2.frame11 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame11.button12
  button .frame8.frame4.frame0.frame1.frame1.frame2.frame11.button12 \
    -command {MasterNextMeleeRound}\
    -text {Next Round}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame11.label13
  label .frame8.frame4.frame0.frame1.frame1.frame2.frame11.label13 \
    -relief {sunken}\
    -text {0}

  # pack widget .frame8.frame4.frame0.frame1.frame1.frame2.frame11
  pack append .frame8.frame4.frame0.frame1.frame1.frame2.frame11 \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame11.button12 {left frame center} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame11.label13 {left frame center} 

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame5
  frame .frame8.frame4.frame0.frame1.frame1.frame2.frame5 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame5.button6
  button .frame8.frame4.frame0.frame1.frame1.frame2.frame5.button6 \
    -command {MasterMeleeHit}\
    -text {Hit}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry7
  entry .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry7 \
    -relief {sunken}\
    -width {1}
  # bindings
  bind .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry7 <Return> {focus [SN MasterMeleeHitNS]}
  bind .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry7 <Tab> {focus [SN MasterMeleeHitNS]}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry9
  entry .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry9 \
    -relief {sunken}\
    -width {2}
  # bindings
  bind .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry9 <Return> {MasterMeleeHit}
  bind .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry9 <Tab> {focus [SN MasterMeleeDamageND]}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame5.label8
  label .frame8.frame4.frame0.frame1.frame1.frame2.frame5.label8 \
    -text {d}

  # build widget .frame8.frame4.frame0.frame1.frame1.frame2.frame5.label9
  label .frame8.frame4.frame0.frame1.frame1.frame2.frame5.label9 \
    -text {}\
    -relief {sunken}\
    -width 4

  # pack widget .frame8.frame4.frame0.frame1.frame1.frame2.frame5
  pack append .frame8.frame4.frame0.frame1.frame1.frame2.frame5 \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame5.button6 {left frame center} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry7 {left frame center} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame5.label8 {left frame center} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry9 {left frame center} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame5.label9 {left frame center}  

  # pack widget .frame8.frame4.frame0.frame1.frame1.frame2
  pack append .frame8.frame4.frame0.frame1.frame1.frame2 \
    .frame8.frame4.frame0.frame1.frame1.frame2.button3 {top frame w expand} \
    .frame8.frame4.frame0.frame1.frame1.frame2.button4 {top frame w expand} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame5 {top frame w expand fillx} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame10 {top frame w expand fillx} \
    .frame8.frame4.frame0.frame1.frame1.frame2.frame11 {top frame w expand fillx} \
    .frame8.frame4.frame0.frame1.frame1.frame2.button14 {top frame w expand} 

  # pack widget .frame8.frame4.frame0.frame1.frame1
  pack append .frame8.frame4.frame0.frame1.frame1 \
    .frame8.frame4.frame0.frame1.frame1.frame2 {left frame center fill} \
    .frame8.frame4.frame0.frame1.frame1.frame0 {left frame center expand fill} 

  # build widget .frame8.frame4.frame0.frame1.frame10
  frame .frame8.frame4.frame0.frame1.frame10 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame10.frame0
  frame .frame8.frame4.frame0.frame1.frame10.frame0 \
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame10.frame0.scrollbar1
  scrollbar .frame8.frame4.frame0.frame1.frame10.frame0.scrollbar1 \
    -command {.frame8.frame4.frame0.frame1.frame10.frame0.canvas2 yview}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame10.frame0.scrollbar3
  scrollbar .frame8.frame4.frame0.frame1.frame10.frame0.scrollbar3 \
    -command {.frame8.frame4.frame0.frame1.frame10.frame0.canvas2 xview}\
    -orient {horizontal}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame10.frame0.canvas2
  canvas .frame8.frame4.frame0.frame1.frame10.frame0.canvas2 \
    -height {144}\
    -insertofftime {600}\
    -relief {raised}\
    -scrollregion {0 0 0 0}\
    -width {324}\
    -xscrollcommand {.frame8.frame4.frame0.frame1.frame10.frame0.scrollbar3 set}\
    -yscrollcommand {.frame8.frame4.frame0.frame1.frame10.frame0.scrollbar1 set}
  # build canvas items .frame8.frame4.frame0.frame1.frame10.frame0.canvas2
  # bindings
  CLBind .frame8.frame4.frame0.frame1.frame10.frame0.canvas2

  # pack widget .frame8.frame4.frame0.frame1.frame10.frame0
  pack append .frame8.frame4.frame0.frame1.frame10.frame0 \
    .frame8.frame4.frame0.frame1.frame10.frame0.scrollbar1 {right frame center filly} \
    .frame8.frame4.frame0.frame1.frame10.frame0.canvas2 {top frame center fill} \
    .frame8.frame4.frame0.frame1.frame10.frame0.scrollbar3 {top frame center fillx} 

  # build widget .frame8.frame4.frame0.frame1.frame10.frame14
  frame .frame8.frame4.frame0.frame1.frame10.frame14 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame10.frame14.button15
  button .frame8.frame4.frame0.frame1.frame10.frame14.button15 \
    -command {MasterAddTrick}\
    -state {disabled}\
    -text {Add}

  # build widget .frame8.frame4.frame0.frame1.frame10.frame14.button16
  button .frame8.frame4.frame0.frame1.frame10.frame14.button16 \
    -command {MasterRemoveTrick}\
    -state {disabled}\
    -text {Remove}

  # build widget .frame8.frame4.frame0.frame1.frame10.frame14.button17
  button .frame8.frame4.frame0.frame1.frame10.frame14.button17 \
    -command {MasterViewTrick}\
    -text {View}

  # pack widget .frame8.frame4.frame0.frame1.frame10.frame14
  pack append .frame8.frame4.frame0.frame1.frame10.frame14 \
    .frame8.frame4.frame0.frame1.frame10.frame14.button15 {top frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame10.frame14.button16 {top frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame10.frame14.button17 {top frame center expand fillx} 

  # pack widget .frame8.frame4.frame0.frame1.frame10
  pack append .frame8.frame4.frame0.frame1.frame10 \
    .frame8.frame4.frame0.frame1.frame10.frame14 {left frame e fill} \
    .frame8.frame4.frame0.frame1.frame10.frame0 {left frame e expand fill} 

  # build widget .frame8.frame4.frame0.frame1.frame11
  frame .frame8.frame4.frame0.frame1.frame11 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame11.frame0
  frame .frame8.frame4.frame0.frame1.frame11.frame0 \
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame11.frame0.scrollbar1
  scrollbar .frame8.frame4.frame0.frame1.frame11.frame0.scrollbar1 \
    -command {.frame8.frame4.frame0.frame1.frame11.frame0.canvas2 yview}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame11.frame0.scrollbar3
  scrollbar .frame8.frame4.frame0.frame1.frame11.frame0.scrollbar3 \
    -command {.frame8.frame4.frame0.frame1.frame11.frame0.canvas2 xview}\
    -orient {horizontal}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame11.frame0.canvas2
  canvas .frame8.frame4.frame0.frame1.frame11.frame0.canvas2 \
    -height {144}\
    -insertofftime {600}\
    -relief {raised}\
    -scrollregion {0 0 0 0}\
    -width {324}\
    -xscrollcommand {.frame8.frame4.frame0.frame1.frame11.frame0.scrollbar3 set}\
    -yscrollcommand {.frame8.frame4.frame0.frame1.frame11.frame0.scrollbar1 set}
  # build canvas items .frame8.frame4.frame0.frame1.frame11.frame0.canvas2
  # bindings
  CLBind .frame8.frame4.frame0.frame1.frame11.frame0.canvas2

  # pack widget .frame8.frame4.frame0.frame1.frame11.frame0
  pack append .frame8.frame4.frame0.frame1.frame11.frame0 \
    .frame8.frame4.frame0.frame1.frame11.frame0.scrollbar1 {right frame center filly} \
    .frame8.frame4.frame0.frame1.frame11.frame0.canvas2 {top frame center fill} \
    .frame8.frame4.frame0.frame1.frame11.frame0.scrollbar3 {top frame center fillx} 

  # build widget .frame8.frame4.frame0.frame1.frame11.frame17
  frame .frame8.frame4.frame0.frame1.frame11.frame17 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame11.frame17.button15
  button .frame8.frame4.frame0.frame1.frame11.frame17.button15 \
    -command {MasterAddTreasure}\
    -state {disabled}\
    -text {Add}

  # build widget .frame8.frame4.frame0.frame1.frame11.frame17.button16
  button .frame8.frame4.frame0.frame1.frame11.frame17.button16 \
    -command {MasterRemoveTreasure}\
    -state {disabled}\
    -text {Remove}

  # build widget .frame8.frame4.frame0.frame1.frame11.frame17.button17
  button .frame8.frame4.frame0.frame1.frame11.frame17.button17 \
    -command {MasterViewTreasure}\
    -text {View}

  # pack widget .frame8.frame4.frame0.frame1.frame11.frame17
  pack append .frame8.frame4.frame0.frame1.frame11.frame17 \
    .frame8.frame4.frame0.frame1.frame11.frame17.button15 {top frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame11.frame17.button16 {top frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame11.frame17.button17 {top frame center expand fillx} 

  # pack widget .frame8.frame4.frame0.frame1.frame11
  pack append .frame8.frame4.frame0.frame1.frame11 \
    .frame8.frame4.frame0.frame1.frame11.frame17 {left frame e fill} \
    .frame8.frame4.frame0.frame1.frame11.frame0 {left frame e expand fill} 

  # build widget .frame8.frame4.frame0.frame1.frame13
  frame .frame8.frame4.frame0.frame1.frame13 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame13.frame0
  frame .frame8.frame4.frame0.frame1.frame13.frame0 \
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame13.frame0.scrollbar1
  scrollbar .frame8.frame4.frame0.frame1.frame13.frame0.scrollbar1 \
    -command {.frame8.frame4.frame0.frame1.frame13.frame0.canvas2 yview}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame13.frame0.scrollbar3
  scrollbar .frame8.frame4.frame0.frame1.frame13.frame0.scrollbar3 \
    -command {.frame8.frame4.frame0.frame1.frame13.frame0.canvas2 xview}\
    -orient {horizontal}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame13.frame0.canvas2
  canvas .frame8.frame4.frame0.frame1.frame13.frame0.canvas2 \
    -height {144}\
    -insertofftime {600}\
    -relief {raised}\
    -scrollregion {0 0 0 0}\
    -width {324}\
    -xscrollcommand {.frame8.frame4.frame0.frame1.frame13.frame0.scrollbar3 set}\
    -yscrollcommand {.frame8.frame4.frame0.frame1.frame13.frame0.scrollbar1 set}
  # build canvas items .frame8.frame4.frame0.frame1.frame13.frame0.canvas2
  # bindings
  CLBind .frame8.frame4.frame0.frame1.frame13.frame0.canvas2

  # pack widget .frame8.frame4.frame0.frame1.frame13.frame0
  pack append .frame8.frame4.frame0.frame1.frame13.frame0 \
    .frame8.frame4.frame0.frame1.frame13.frame0.scrollbar1 {right frame center filly} \
    .frame8.frame4.frame0.frame1.frame13.frame0.canvas2 {top frame center fill} \
    .frame8.frame4.frame0.frame1.frame13.frame0.scrollbar3 {top frame center fillx} 

  # build widget .frame8.frame4.frame0.frame1.frame13.frame17
  frame .frame8.frame4.frame0.frame1.frame13.frame17 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame13.frame17.button15
  button .frame8.frame4.frame0.frame1.frame13.frame17.button15 \
    -command {MasterAddOther}\
    -state {disabled}\
    -text {Add}

  # build widget .frame8.frame4.frame0.frame1.frame13.frame17.button16
  button .frame8.frame4.frame0.frame1.frame13.frame17.button16 \
    -command {MasterRemoveOther}\
    -state {disabled}\
    -text {Remove}

  # build widget .frame8.frame4.frame0.frame1.frame13.frame17.button17
  button .frame8.frame4.frame0.frame1.frame13.frame17.button17 \
    -command {MasterViewOther}\
    -text {View}

  # pack widget .frame8.frame4.frame0.frame1.frame13.frame17
  pack append .frame8.frame4.frame0.frame1.frame13.frame17 \
    .frame8.frame4.frame0.frame1.frame13.frame17.button15 {top frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame13.frame17.button16 {top frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame13.frame17.button17 {top frame center expand fillx} 

  # pack widget .frame8.frame4.frame0.frame1.frame13
  pack append .frame8.frame4.frame0.frame1.frame13 \
    .frame8.frame4.frame0.frame1.frame13.frame17 {left frame e fill} \
    .frame8.frame4.frame0.frame1.frame13.frame0 {left frame e expand fill} 

  # build widget .frame8.frame4.frame0.frame1.frame3
  frame .frame8.frame4.frame0.frame1.frame3 \
    -relief {raised}\
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame3.buttons
  frame .frame8.frame4.frame0.frame1.frame3.buttons \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame3.buttons.button23
  button .frame8.frame4.frame0.frame1.frame3.buttons.button23 \
    -command {MasterCreateNewTrick}\
    -text {Create Trick/Trap}

  # build widget .frame8.frame4.frame0.frame1.frame3.buttons.button24
  button .frame8.frame4.frame0.frame1.frame3.buttons.button24 \
    -command {MasterCreateNewTreasure}\
    -text {Create Treasure}

  # build widget .frame8.frame4.frame0.frame1.frame3.buttons.button25
  button .frame8.frame4.frame0.frame1.frame3.buttons.button25 \
    -command {MasterCreateTrickTreasureFormReset}\
    -text {Reset Form}

  # pack widget .frame8.frame4.frame0.frame1.frame3.buttons
  pack append .frame8.frame4.frame0.frame1.frame3.buttons \
    .frame8.frame4.frame0.frame1.frame3.buttons.button25 {left frame center expand} \
    .frame8.frame4.frame0.frame1.frame3.buttons.button23 {left frame center expand} \
    .frame8.frame4.frame0.frame1.frame3.buttons.button24 {left frame center expand} 

  # build widget .frame8.frame4.frame0.frame1.frame3.descrFrame
  frame .frame8.frame4.frame0.frame1.frame3.descrFrame \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame3.descrFrame.entry19
  entry .frame8.frame4.frame0.frame1.frame3.descrFrame.entry19 \
    -relief {sunken}
  # bindings
  bind .frame8.frame4.frame0.frame1.frame3.descrFrame.entry19 <Key-Return> {focus [SN MasterCreateTrickTreasureEPValue]}
  bind .frame8.frame4.frame0.frame1.frame3.descrFrame.entry19 <Key-Tab> {focus [SN MasterCreateTrickTreasureEPValue]}

  # build widget .frame8.frame4.frame0.frame1.frame3.descrFrame.label18
  label .frame8.frame4.frame0.frame1.frame3.descrFrame.label18 \
    -text {Description:}

  # pack widget .frame8.frame4.frame0.frame1.frame3.descrFrame
  pack append .frame8.frame4.frame0.frame1.frame3.descrFrame \
    .frame8.frame4.frame0.frame1.frame3.descrFrame.label18 {left frame center} \
    .frame8.frame4.frame0.frame1.frame3.descrFrame.entry19 {left frame center expand fillx} 

  # build widget .frame8.frame4.frame0.frame1.frame3.epFrame
  frame .frame8.frame4.frame0.frame1.frame3.epFrame \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame3.epFrame.entry15
  entry .frame8.frame4.frame0.frame1.frame3.epFrame.entry15 \
    -relief {sunken}
  # bindings
  bind .frame8.frame4.frame0.frame1.frame3.epFrame.entry15 <Key-Return> {focus [SN MasterCreateTrickTreasureValue]}
  bind .frame8.frame4.frame0.frame1.frame3.epFrame.entry15 <Key-Tab> {focus [SN MasterCreateTrickTreasureValue]}

  # build widget .frame8.frame4.frame0.frame1.frame3.epFrame.label14
  label .frame8.frame4.frame0.frame1.frame3.epFrame.label14 \
    -text {Experience Point Value:}

  # pack widget .frame8.frame4.frame0.frame1.frame3.epFrame
  pack append .frame8.frame4.frame0.frame1.frame3.epFrame \
    .frame8.frame4.frame0.frame1.frame3.epFrame.label14 {left frame center} \
    .frame8.frame4.frame0.frame1.frame3.epFrame.entry15 {left frame center expand fillx} 

  # build widget .frame8.frame4.frame0.frame1.frame3.nameFrame
  frame .frame8.frame4.frame0.frame1.frame3.nameFrame \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame3.nameFrame.entry13
  entry .frame8.frame4.frame0.frame1.frame3.nameFrame.entry13 \
    -relief {sunken}
  # bindings
  bind .frame8.frame4.frame0.frame1.frame3.nameFrame.entry13 <Key-Return> {focus [SN MasterCreateTrickTreasureType]}
  bind .frame8.frame4.frame0.frame1.frame3.nameFrame.entry13 <Key-Tab> {focus [SN MasterCreateTrickTreasureType]}

  # build widget .frame8.frame4.frame0.frame1.frame3.nameFrame.label12
  label .frame8.frame4.frame0.frame1.frame3.nameFrame.label12 \
    -text {Name:}

  # pack widget .frame8.frame4.frame0.frame1.frame3.nameFrame
  pack append .frame8.frame4.frame0.frame1.frame3.nameFrame \
    .frame8.frame4.frame0.frame1.frame3.nameFrame.label12 {left frame center} \
    .frame8.frame4.frame0.frame1.frame3.nameFrame.entry13 {left frame center expand fillx} 

  # build widget .frame8.frame4.frame0.frame1.frame3.typeFrame
  frame .frame8.frame4.frame0.frame1.frame3.typeFrame \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame3.typeFrame.entry17
  entry .frame8.frame4.frame0.frame1.frame3.typeFrame.entry17 \
    -relief {sunken}
  # bindings
  bind .frame8.frame4.frame0.frame1.frame3.typeFrame.entry17 <Key-Return> {focus [SN MasterCreateTrickTreasureDescription]}
  bind .frame8.frame4.frame0.frame1.frame3.typeFrame.entry17 <Key-Tab> {focus [SN MasterCreateTrickTreasureDescription]}

  # build widget .frame8.frame4.frame0.frame1.frame3.typeFrame.label16
  label .frame8.frame4.frame0.frame1.frame3.typeFrame.label16 \
    -text {Type:}

  # pack widget .frame8.frame4.frame0.frame1.frame3.typeFrame
  pack append .frame8.frame4.frame0.frame1.frame3.typeFrame \
    .frame8.frame4.frame0.frame1.frame3.typeFrame.label16 {left frame center} \
    .frame8.frame4.frame0.frame1.frame3.typeFrame.entry17 {left frame center expand fillx} 

  # build widget .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame
  frame .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.checkbutton22
  checkbutton .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.checkbutton22 \
    -text {Is Unique?}\
    -variable {MasterCreateTrickTreasureIsUnique}

  # build widget .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.entry21
  entry .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.entry21 \
    -relief {sunken}
  # bindings
  bind .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.entry21 <Key-Return> {focus [SN MasterCreateTrickTreasureName]}
  bind .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.entry21 <Key-Tab> {focus [SN MasterCreateTrickTreasureName]}

  # build widget .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.label20
  label .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.label20 \
    -text {Value:}

  # pack widget .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame
  pack append .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame \
    .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.label20 {left frame center} \
    .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.entry21 {left frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.checkbutton22 {left frame center} 

  # pack widget .frame8.frame4.frame0.frame1.frame3
  pack append .frame8.frame4.frame0.frame1.frame3 \
    .frame8.frame4.frame0.frame1.frame3.nameFrame {top frame center fill} \
    .frame8.frame4.frame0.frame1.frame3.typeFrame {top frame center fill} \
    .frame8.frame4.frame0.frame1.frame3.descrFrame {top frame center fill} \
    .frame8.frame4.frame0.frame1.frame3.epFrame {top frame center fill} \
    .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame {top frame center fill} \
    .frame8.frame4.frame0.frame1.frame3.buttons {top frame center fill} 

  # build widget .frame8.frame4.frame0.frame1.frame2
  frame .frame8.frame4.frame0.frame1.frame2 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame2.space
  canvas .frame8.frame4.frame0.frame1.frame2.space \
    -relief {raised}\
    -height {100}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -selectborderwidth {2}\
    -width {100}
  # build canvas items .frame8.frame4.frame0.frame1.frame2.space
  global MasterExitPositionList
  foreach e $MasterExitPositionList {
    menu .frame8.frame4.frame0.frame1.frame2.[lindex $e 0]
    set xfTmpMenu .frame8.frame4.frame0.frame1.frame2.[lindex $e 0]
    set xfTmpExit [lindex $e 0]
    foreach d {None Doorway Door DoorSecret DoorLocked DoorOneWay StairsUp 
	       StairsDown RampUp RampDown} {
      if {$xfTmpExit == "up" && $d == "StairsDown"} {continue}
      if {$xfTmpExit == "up" && $d == "RampDown"} {continue}
      if {$xfTmpExit == "down" && $d == "StairsUp"} {continue}
      if {$xfTmpExit == "down" && $d == "RampUp"} {continue}
      $xfTmpMenu add command \
	-command "MasterExitButtonSet $xfTmpExit $d" \
	-label "$d"
    }
  }
  MasterExitSpaceBindBoxes
  

  # build widget .frame8.frame4.frame0.frame1.frame2.buttons
  frame .frame8.frame4.frame0.frame1.frame2.buttons \
    -borderwidth {2}\
    -relief {flat}

  # build widget .frame8.frame4.frame0.frame1.frame2.buttons.install
  button .frame8.frame4.frame0.frame1.frame2.buttons.install \
    -command {MasterInstallDoors}\
    -state {disabled}\
    -text {Install Doors}
  
  # build widget .frame8.frame4.frame0.frame1.frame2.buttons.reset
  button .frame8.frame4.frame0.frame1.frame2.buttons.reset \
    -command {MasterResetDoors}\
    -state {disabled}\
    -text {Reset Doors}
  
  # pack widget .frame8.frame4.frame0.frame1.frame2.buttons
  pack append .frame8.frame4.frame0.frame1.frame2.buttons \
    .frame8.frame4.frame0.frame1.frame2.buttons.install {left frame center expand} \
    .frame8.frame4.frame0.frame1.frame2.buttons.reset {left frame center expand}

  # pack widget .frame8.frame4.frame0.frame1.frame2
  pack append .frame8.frame4.frame0.frame1.frame2 \
    .frame8.frame4.frame0.frame1.frame2.space {top frame center expand} \
    .frame8.frame4.frame0.frame1.frame2.buttons {top frame center expand fill}

  # build widget .frame8.frame4.frame0.frame1.frame9
  frame .frame8.frame4.frame0.frame1.frame9 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame9.frame0
  frame .frame8.frame4.frame0.frame1.frame9.frame0 \
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame9.frame0.scrollbar1
  scrollbar .frame8.frame4.frame0.frame1.frame9.frame0.scrollbar1 \
    -command {.frame8.frame4.frame0.frame1.frame9.frame0.canvas2 yview}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame9.frame0.scrollbar3
  scrollbar .frame8.frame4.frame0.frame1.frame9.frame0.scrollbar3 \
    -command {.frame8.frame4.frame0.frame1.frame9.frame0.canvas2 xview}\
    -orient {horizontal}\
    -relief {raised}

  # build widget .frame8.frame4.frame0.frame1.frame9.frame0.canvas2
  canvas .frame8.frame4.frame0.frame1.frame9.frame0.canvas2 \
    -height {144}\
    -insertofftime {600}\
    -relief {raised}\
    -scrollregion {0 0 0 0}\
    -width {285}\
    -xscrollcommand {.frame8.frame4.frame0.frame1.frame9.frame0.scrollbar3 set}\
    -yscrollcommand {.frame8.frame4.frame0.frame1.frame9.frame0.scrollbar1 set}
  # build canvas items .frame8.frame4.frame0.frame1.frame9.frame0.canvas2
  # bindings
  CLBind .frame8.frame4.frame0.frame1.frame9.frame0.canvas2

  # pack widget .frame8.frame4.frame0.frame1.frame9.frame0
  pack append .frame8.frame4.frame0.frame1.frame9.frame0 \
    .frame8.frame4.frame0.frame1.frame9.frame0.scrollbar1 {right frame center filly} \
    .frame8.frame4.frame0.frame1.frame9.frame0.canvas2 {top frame center fill} \
    .frame8.frame4.frame0.frame1.frame9.frame0.scrollbar3 {top frame center fillx} 

  # build widget .frame8.frame4.frame0.frame1.frame9.frame14
  frame .frame8.frame4.frame0.frame1.frame9.frame14 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame0.frame1.frame9.frame14.button15
  button .frame8.frame4.frame0.frame1.frame9.frame14.button15 \
    -command {MasterAddMonster}\
    -state {disabled}\
    -text {Add}

  # build widget .frame8.frame4.frame0.frame1.frame9.frame14.button16
  button .frame8.frame4.frame0.frame1.frame9.frame14.button16 \
    -command {MasterRemoveMonster}\
    -state {disabled}\
    -text {Remove}

  # build widget .frame8.frame4.frame0.frame1.frame9.frame14.button17
  button .frame8.frame4.frame0.frame1.frame9.frame14.button17 \
    -command {MasterViewMonster}\
    -text {View}

  # build widget .frame8.frame4.frame0.frame1.frame9.frame14.button18
  button .frame8.frame4.frame0.frame1.frame9.frame14.button18 \
    -command {MasterCreateMonster}\
    -state {disabled}\
    -text {Create New Monster}

  # build widget .frame8.frame4.frame0.frame1.frame9.frame14.button19
  button .frame8.frame4.frame0.frame1.frame9.frame14.button19 \
    -command {MasterCreateNPC}\
    -state {disabled}\
    -text {Create New NPC}

  # pack widget .frame8.frame4.frame0.frame1.frame9.frame14
  pack append .frame8.frame4.frame0.frame1.frame9.frame14 \
    .frame8.frame4.frame0.frame1.frame9.frame14.button15 {top frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame9.frame14.button16 {top frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame9.frame14.button17 {top frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame9.frame14.button18 {top frame center expand fillx} \
    .frame8.frame4.frame0.frame1.frame9.frame14.button19 {top frame center expand fillx} 

  # pack widget .frame8.frame4.frame0.frame1.frame9
  pack append .frame8.frame4.frame0.frame1.frame9 \
    .frame8.frame4.frame0.frame1.frame9.frame14 {left frame e fill} \
    .frame8.frame4.frame0.frame1.frame9.frame0 {left frame e expand fill} 

  # build widget .frame8.frame4.frame0.spacebuttons
  frame .frame8.frame4.frame0.spacebuttons \
    -borderwidth {2}\
    -relief {flat}

  # build widget .frame8.frame4.frame0.spacebuttons.addspace
  button .frame8.frame4.frame0.spacebuttons.addspace \
    -command {MasterAddSpace}\
    -state {disabled}\
    -text {Add Space}

  # build widget .frame8.frame4.frame0.spacebuttons.remospace
  button .frame8.frame4.frame0.spacebuttons.remospace \
    -command {MasterRemoveSpace}\
    -state {disabled}\
    -text {Remove Space}

  # build widget .frame8.frame4.frame0.spacebuttons.updatespace
  button .frame8.frame4.frame0.spacebuttons.updatespace \
    -command {MasterUpdateSpace}\
    -state {disabled}\
    -text {Update Space}

  # pack widget .frame8.frame4.frame0.spacebuttons
  pack append .frame8.frame4.frame0.spacebuttons \
    .frame8.frame4.frame0.spacebuttons.addspace {left frame center expand} \
    .frame8.frame4.frame0.spacebuttons.remospace {left frame center expand} \
    .frame8.frame4.frame0.spacebuttons.updatespace {left frame center expand}
    

  # pack widget .frame8.frame4.frame0.frame1
  pack append .frame8.frame4.frame0.frame1 \
    .frame8.frame4.frame0.frame1.frame9 {top frame center fill} 

  # pack widget .frame8.frame4.frame0
  pack append .frame8.frame4.frame0 \
    .frame8.frame4.frame0.frame {top frame center fill} \
    .frame8.frame4.frame0.spacebuttons {top frame center fill} \
    .frame8.frame4.frame0.frame1 {top frame center expand fill} 

  # build widget .frame8.frame4.frame2
  frame .frame8.frame4.frame2 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame2.frame3
  frame .frame8.frame4.frame2.frame3 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame2.frame3.frame6
  frame .frame8.frame4.frame2.frame3.frame6 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame2.frame3.frame6.canvas15
  canvas .frame8.frame4.frame2.frame3.frame6.canvas15 \
    -height {100}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -selectborderwidth {2}\
    -width {100}
  # build canvas items .frame8.frame4.frame2.frame3.frame6.canvas15
  # bindings
  bind .frame8.frame4.frame2.frame3.frame6.canvas15 <B1-Motion> {MoveDrag %W %x %y}
  bind .frame8.frame4.frame2.frame3.frame6.canvas15 <Button-1> {MoveStart %W %x %y [CheckMasterMode Build]}
  bind .frame8.frame4.frame2.frame3.frame6.canvas15 <Button-3> {DescribeBitMap %W %x %y}
  bind .frame8.frame4.frame2.frame3.frame6.canvas15 <ButtonRelease-1> {MoveEnd %W}

  # pack widget .frame8.frame4.frame2.frame3.frame6
  pack append .frame8.frame4.frame2.frame3.frame6 \
    .frame8.frame4.frame2.frame3.frame6.canvas15 {top frame center} 

  # build widget .frame8.frame4.frame2.frame3.frame7
  frame .frame8.frame4.frame2.frame3.frame7 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame2.frame3.frame7.canvas15
  canvas .frame8.frame4.frame2.frame3.frame7.canvas15 \
    -height {100}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -selectborderwidth {2}\
    -width {100}
  # build canvas items .frame8.frame4.frame2.frame3.frame7.canvas15
  # bindings
  bind .frame8.frame4.frame2.frame3.frame7.canvas15 <B1-Motion> {MoveDrag %W %x %y}
  bind .frame8.frame4.frame2.frame3.frame7.canvas15 <Button-1> {MoveStart %W %x %y [CheckMasterMode Build]}
  bind .frame8.frame4.frame2.frame3.frame7.canvas15 <Button-3> {DescribeBitMap %W %x %y}
  bind .frame8.frame4.frame2.frame3.frame7.canvas15 <ButtonRelease-1> {MoveEnd %W}

  # pack widget .frame8.frame4.frame2.frame3.frame7
  pack append .frame8.frame4.frame2.frame3.frame7 \
    .frame8.frame4.frame2.frame3.frame7.canvas15 {top frame center} 

  # build widget .frame8.frame4.frame2.frame3.frame8
  frame .frame8.frame4.frame2.frame3.frame8 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame2.frame3.frame8.canvas15
  canvas .frame8.frame4.frame2.frame3.frame8.canvas15 \
    -height {100}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -selectborderwidth {2}\
    -width {100}
  # build canvas items .frame8.frame4.frame2.frame3.frame8.canvas15
  # bindings
  bind .frame8.frame4.frame2.frame3.frame8.canvas15 <B1-Motion> {MoveDrag %W %x %y}
  bind .frame8.frame4.frame2.frame3.frame8.canvas15 <Button-1> {MoveStart %W %x %y [CheckMasterMode Build]}
  bind .frame8.frame4.frame2.frame3.frame8.canvas15 <Button-3> {DescribeBitMap %W %x %y}
  bind .frame8.frame4.frame2.frame3.frame8.canvas15 <ButtonRelease-1> {MoveEnd %W}

  # pack widget .frame8.frame4.frame2.frame3.frame8
  pack append .frame8.frame4.frame2.frame3.frame8 \
    .frame8.frame4.frame2.frame3.frame8.canvas15 {top frame center} 

  # pack widget .frame8.frame4.frame2.frame3
  pack append .frame8.frame4.frame2.frame3 \
    .frame8.frame4.frame2.frame3.frame6 {left frame center} \
    .frame8.frame4.frame2.frame3.frame7 {left frame center} \
    .frame8.frame4.frame2.frame3.frame8 {left frame center} 

  # build widget .frame8.frame4.frame2.frame4
  frame .frame8.frame4.frame2.frame4 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame2.frame4.frame10
  frame .frame8.frame4.frame2.frame4.frame10 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame2.frame4.frame10.canvas15
  canvas .frame8.frame4.frame2.frame4.frame10.canvas15 \
    -height {100}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -selectborderwidth {2}\
    -width {100}
  # build canvas items .frame8.frame4.frame2.frame4.frame10.canvas15
  # bindings
  bind .frame8.frame4.frame2.frame4.frame10.canvas15 <B1-Motion> {MoveDrag %W %x %y}
  bind .frame8.frame4.frame2.frame4.frame10.canvas15 <Button-1> {MoveStart %W %x %y [CheckMasterMode Build]}
  bind .frame8.frame4.frame2.frame4.frame10.canvas15 <Button-3> {DescribeBitMap %W %x %y}
  bind .frame8.frame4.frame2.frame4.frame10.canvas15 <ButtonRelease-1> {MoveEnd %W}

  # pack widget .frame8.frame4.frame2.frame4.frame10
  pack append .frame8.frame4.frame2.frame4.frame10 \
    .frame8.frame4.frame2.frame4.frame10.canvas15 {top frame center} 

  # build widget .frame8.frame4.frame2.frame4.frame11
  frame .frame8.frame4.frame2.frame4.frame11 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame2.frame4.frame11.canvas15
  canvas .frame8.frame4.frame2.frame4.frame11.canvas15 \
    -height {100}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -selectborderwidth {2}\
    -width {100}
  # build canvas items .frame8.frame4.frame2.frame4.frame11.canvas15
  # bindings
  bind .frame8.frame4.frame2.frame4.frame11.canvas15 <B1-Motion> {MoveDrag %W %x %y}
  bind .frame8.frame4.frame2.frame4.frame11.canvas15 <Button-1> {MoveStart %W %x %y [CheckMasterMode Build]}
  bind .frame8.frame4.frame2.frame4.frame11.canvas15 <Button-3> {DescribeBitMap %W %x %y}
  bind .frame8.frame4.frame2.frame4.frame11.canvas15 <ButtonRelease-1> {MoveEnd %W}

  # pack widget .frame8.frame4.frame2.frame4.frame11
  pack append .frame8.frame4.frame2.frame4.frame11 \
    .frame8.frame4.frame2.frame4.frame11.canvas15 {top frame center} 

  # build widget .frame8.frame4.frame2.frame4.frame9
  frame .frame8.frame4.frame2.frame4.frame9 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame2.frame4.frame9.canvas15
  canvas .frame8.frame4.frame2.frame4.frame9.canvas15 \
    -height {100}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -selectborderwidth {2}\
    -width {100}
  # build canvas items .frame8.frame4.frame2.frame4.frame9.canvas15
  # bindings
  bind .frame8.frame4.frame2.frame4.frame9.canvas15 <B1-Motion> {MoveDrag %W %x %y}
  bind .frame8.frame4.frame2.frame4.frame9.canvas15 <Button-1> {MoveStart %W %x %y [CheckMasterMode Build]}
  bind .frame8.frame4.frame2.frame4.frame9.canvas15 <Button-3> {DescribeBitMap %W %x %y}
  bind .frame8.frame4.frame2.frame4.frame9.canvas15 <ButtonRelease-1> {MoveEnd %W}

  # pack widget .frame8.frame4.frame2.frame4.frame9
  pack append .frame8.frame4.frame2.frame4.frame9 \
    .frame8.frame4.frame2.frame4.frame9.canvas15 {top frame center} 

  # pack widget .frame8.frame4.frame2.frame4
  pack append .frame8.frame4.frame2.frame4 \
    .frame8.frame4.frame2.frame4.frame9 {left frame center expand fillx} \
    .frame8.frame4.frame2.frame4.frame10 {left frame center expand fillx} \
    .frame8.frame4.frame2.frame4.frame11 {left frame center expand fillx} 

  # build widget .frame8.frame4.frame2.frame5
  frame .frame8.frame4.frame2.frame5 \
    -borderwidth {2}

  # build widget .frame8.frame4.frame2.frame5.frame12
  frame .frame8.frame4.frame2.frame5.frame12 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame2.frame5.frame12.canvas15
  canvas .frame8.frame4.frame2.frame5.frame12.canvas15 \
    -height {100}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -selectborderwidth {2}\
    -width {100}
  # build canvas items .frame8.frame4.frame2.frame5.frame12.canvas15
  # bindings
  bind .frame8.frame4.frame2.frame5.frame12.canvas15 <B1-Motion> {MoveDrag %W %x %y}
  bind .frame8.frame4.frame2.frame5.frame12.canvas15 <Button-1> {MoveStart %W %x %y [CheckMasterMode Build]}
  bind .frame8.frame4.frame2.frame5.frame12.canvas15 <Button-3> {DescribeBitMap %W %x %y}
  bind .frame8.frame4.frame2.frame5.frame12.canvas15 <ButtonRelease-1> {MoveEnd %W}

  # pack widget .frame8.frame4.frame2.frame5.frame12
  pack append .frame8.frame4.frame2.frame5.frame12 \
    .frame8.frame4.frame2.frame5.frame12.canvas15 {top frame center} 

  # build widget .frame8.frame4.frame2.frame5.frame13
  frame .frame8.frame4.frame2.frame5.frame13 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame2.frame5.frame13.canvas15
  canvas .frame8.frame4.frame2.frame5.frame13.canvas15 \
    -height {100}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -selectborderwidth {2}\
    -width {100}
  # build canvas items .frame8.frame4.frame2.frame5.frame13.canvas15
  # bindings
  bind .frame8.frame4.frame2.frame5.frame13.canvas15 <B1-Motion> {MoveDrag %W %x %y}
  bind .frame8.frame4.frame2.frame5.frame13.canvas15 <Button-1> {MoveStart %W %x %y [CheckMasterMode Build]}
  bind .frame8.frame4.frame2.frame5.frame13.canvas15 <Button-3> {DescribeBitMap %W %x %y}
  bind .frame8.frame4.frame2.frame5.frame13.canvas15 <ButtonRelease-1> {MoveEnd %W}

  # pack widget .frame8.frame4.frame2.frame5.frame13
  pack append .frame8.frame4.frame2.frame5.frame13 \
    .frame8.frame4.frame2.frame5.frame13.canvas15 {top frame center} 

  # build widget .frame8.frame4.frame2.frame5.frame14
  frame .frame8.frame4.frame2.frame5.frame14 \
    -borderwidth {2}\
    -relief {raised}

  # build widget .frame8.frame4.frame2.frame5.frame14.canvas15
  canvas .frame8.frame4.frame2.frame5.frame14.canvas15 \
    -height {100}\
    -insertborderwidth {2}\
    -insertofftime {600}\
    -selectborderwidth {2}\
    -width {100}
  # build canvas items .frame8.frame4.frame2.frame5.frame14.canvas15
  # bindings
  bind .frame8.frame4.frame2.frame5.frame14.canvas15 <B1-Motion> {MoveDrag %W %x %y}
  bind .frame8.frame4.frame2.frame5.frame14.canvas15 <Button-1> {MoveStart %W %x %y [CheckMasterMode Build]}
  bind .frame8.frame4.frame2.frame5.frame14.canvas15 <Button-3> {DescribeBitMap %W %x %y}
  bind .frame8.frame4.frame2.frame5.frame14.canvas15 <ButtonRelease-1> {MoveEnd %W}

  # pack widget .frame8.frame4.frame2.frame5.frame14
  pack append .frame8.frame4.frame2.frame5.frame14 \
    .frame8.frame4.frame2.frame5.frame14.canvas15 {top frame center} 

  # pack widget .frame8.frame4.frame2.frame5
  pack append .frame8.frame4.frame2.frame5 \
    .frame8.frame4.frame2.frame5.frame12 {left frame center expand fillx} \
    .frame8.frame4.frame2.frame5.frame13 {left frame center expand fillx} \
    .frame8.frame4.frame2.frame5.frame14 {left frame center expand fillx} 

  # pack widget .frame8.frame4.frame2
  pack append .frame8.frame4.frame2 \
    .frame8.frame4.frame2.frame3 {top frame center} \
    .frame8.frame4.frame2.frame4 {top frame center} \
    .frame8.frame4.frame2.frame5 {top frame center} 

  # pack widget .frame8.frame4
  pack append .frame8.frame4 \
    .frame8.frame4.frame2 {left frame center expand fillx} \
    .frame8.frame4.frame0 {left frame center expand fill} 

  # build widget .frame8.frame5
  frame .frame8.frame5 \
    -borderwidth {2}

  # build widget .frame8.frame5.button6
  button .frame8.frame5.button6 \
    -command {set NS [[SN MasterDiceNS] get]
set ND [[SN MasterDiceND] get]
if {[string trim $NS] == "%"} {
  set MasterDice [Dice 0]
} else {
  set MasterDice [Dice $NS $ND]
}
set roll [$MasterDice roll]
$MasterDice delete
[SN MasterDiceRoll] configure -text "[format "%d" $roll]"
}\
    -text {Roll Dice: }

  # build widget .frame8.frame5.label11
  label .frame8.frame5.label11 \
    -relief {sunken}\
    -text {}\
    -width {5}

  # build widget .frame8.frame5.entry7
  entry .frame8.frame5.entry7 \
    -relief {sunken}\
    -width {2}
  # bindings
  bind .frame8.frame5.entry7 <Return> {focus [SN MasterDiceNS]}
  bind .frame8.frame5.entry7 <Tab> {focus [SN MasterDiceNS]}

  # build widget .frame8.frame5.entry9
  entry .frame8.frame5.entry9 \
    -relief {sunken}\
    -width {2}
  # bindings
  bind .frame8.frame5.entry9 <Return> {.frame8.frame5.button6 invoke}
  bind .frame8.frame5.entry9 <Tab> {focus [SN MasterDiceND]}

  # build widget .frame8.frame5.label10
  label .frame8.frame5.label10 \
    -text { = }

  # build widget .frame8.frame5.label8
  label .frame8.frame5.label8 \
    -text {d}

  # build widget .frame8.frame5.button7
  button .frame8.frame5.button7 \
    -command {global MasterMode
if {$MasterMode == "Build"} {
  MasterEditDungeonComments
} else {
  MasterEditGameNotes
}
}\
    -text {Edit Comments}

  # pack widget .frame8.frame5
  pack append .frame8.frame5 \
    .frame8.frame5.button6 {left frame center fillx} \
    .frame8.frame5.entry7 {left frame center fillx} \
    .frame8.frame5.label8 {left frame center fillx} \
    .frame8.frame5.entry9 {left frame center fillx} \
    .frame8.frame5.label10 {left frame center fillx} \
    .frame8.frame5.label11 {left frame center fillx} \
    .frame8.frame5.button7 {right frame e expand}

  # build widget .frame8.label1
  label .frame8.label1 \
    -font {-Adobe-Helvetica-Bold-R-Normal--*-240-*}\
    -text {Master}

  # pack widget .frame8
  pack append .frame8 \
    .frame8.label1 {top frame e expand fill} \
    .frame8.frame3 {top frame w} \
    .frame8.frame4 {top frame center fill} \
    .frame8.frame1 {top frame center fillx} \
    .frame8.frame16 {top frame center expand fillx} \
    .frame8.frame5 {top frame center fillx} 

  # pack widget .
  pack append . \
    .frame0 {top frame center fillx} \
    .frame8 {top frame center} 

  if {"[info procs XFEdit]" != ""} {
    XFEditSetShowWindows
    XFMiscBindWidgetTree .xfModules
  }

  global tkVersion
  if {$tkVersion >= 3.0} {
    tk_menuBar .frame0 .frame0.menubutton1 .frame0.menubutton2 .frame0.menubutton4 .frame0.menubutton5 .frame0.menubutton6
  } {
    tk_menus . .frame0.menubutton1 .frame0.menubutton2 .frame0.menubutton4 .frame0.menubutton5 .frame0.menubutton6
  }

  .frame3.frame.text2 insert end {}
  .frame3.frame0.entry3 insert end {0}
  .frame3.frame17.entry20 insert end {}
  .frame3.frame18.entry22 insert end {}
  .frame3.frame2.entry20 insert end {}
  .frame3.frame23.entry22 insert end {Human}
  .frame3.frame24.entry28 insert end {npc}
  .frame3.frame3.frame4.frame5.entry2 insert end {0}
  .frame3.frame3.frame4.frame5.entry3 insert end {}
  .frame3.frame3.frame4.frame6.entry4 insert end {0}
  .frame3.frame3.frame4.frame7.entry3 insert end {0}
  .frame3.frame3.frame5.frame10.entry16 insert end {0}
  .frame3.frame3.frame5.frame8.entry12 insert end {0}
  .frame3.frame3.frame5.frame9.entry14 insert end {0}
  .frame3.frame5.entry20 insert end {}
  .frame3.frame7.entry20 insert end {}
  .frame7.frame.text2 insert end {}
  .frame7.frame0.frame0.entry2 insert end {}
  .frame7.frame0.frame2.entry19 insert end {}
  .frame7.frame0.frame24.entry23 insert end {}
  .frame7.frame0.frame25.entry23 insert end {}
  .frame7.frame0.frame26.frame27.entry30 insert end {1}
  .frame7.frame0.frame26.frame27.entry32 insert end {8}
  .frame7.frame0.frame26.frame28.entry34 insert end {}
  .frame7.frame0.frame3.entry21 insert end {}
  .frame7.frame0.frame35.entry23 insert end {}
  .frame7.frame0.frame36.entry23 insert end {}
  .frame7.frame0.frame37.entry23 insert end {}
  .frame7.frame0.frame38.entry23 insert end {}
  .frame7.frame0.frame39.entry23 insert end {}
  .frame7.frame0.frame4.entry23 insert end {}
  .frame7.frame0.frame40.entry23 insert end {}
  .frame7.frame0.frame41.entry23 insert end {}
  .frame7.frame0.frame42.entry23 insert end {}
  .frame7.frame0.frame43.entry23 insert end {}
  .frame7.frame0.frame44.entry23 insert end {}
  .frame8.frame3.entry6 insert end {0}
  .frame8.frame3.entry7 insert end {0}
  .frame8.frame3.entry8 insert end {0}
  .frame8.frame4.frame0.frame.text2 insert end {}
  .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry7 insert end {1}
  .frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry9 insert end {6}
  .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry7 insert end {1}
  .frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry9 insert end {6}
  .frame8.frame4.frame0.frame1.frame3.descrFrame.entry19 insert end {}
  .frame8.frame4.frame0.frame1.frame3.epFrame.entry15 insert end {0}
  .frame8.frame4.frame0.frame1.frame3.nameFrame.entry13 insert end {}
  .frame8.frame4.frame0.frame1.frame3.typeFrame.entry17 insert end {}
  .frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.entry21 insert end {0}
  .frame8.frame5.entry7 insert end {1}
  .frame8.frame5.entry9 insert end {8}


}


# User defined procedures


# Procedure: Exit
proc Exit {} {
  global CurrentCharacter
  if {$CurrentCharacter(handle) != {}} {
    if {$CurrentCharacter(isdirty)} {
      set answer [YesNoBox "Modified character data in character frame, lose it?"]
      if {!$answer} {
	return
      }
    }
  }
  global CurrentMasterDungeon
  if {$CurrentMasterDungeon(handle) != {}} {
    if {$CurrentMasterDungeon(isdirty)} {
      set answer [YesNoBox "Modified master dungeon data in master frame, lose it?"]
      if {!$answer} {
	return
      }
    }
  }
  global CurrentMasterGame
  if {$CurrentMasterGame(handle) != {}} {
    if {$CurrentMasterGame(isdirty)} {
      set answer [YesNoBox "Modified master game data in master frame, lose it?"]
      if {!$answer} {
	return
      }
    }
  }
  global CurrentMonster
  if {$CurrentMonster(handle) != {}} {
    if {$CurrentMonster(isdirty)} {
      set answer [YesNoBox "Modified monster data in monster frame, lose it?"]
      if {!$answer} {
	return
      }
    }
  }
  exit
}


# Procedure: NewFrame
proc NewFrame {} {
  global CurrentFrame
  case $CurrentFrame in {
    {CharacterFrame} {
      global CurrentCharacter
      if {$CurrentCharacter(handle) != {}} {
	if {$CurrentCharacter(isdirty)} {
	  set answer [YesNoBox "Modified character data in character frame, lose it?"]
	  if {!$answer} {
	    return
	  }
	}
	$CurrentCharacter(handle) delete
	set CurrentCharacter(handle) {}
	set CurrentCharacter(isdirty) 0
	set CurrentCharacter(filename) {}
	ResetCharacterForm
      }
      set abilities [RollCharacter]
      if {$abilities == {}} {
	set CurrentCharacter(handle) [Character]
	set CurrentCharacter(filename) {new.character}
	ResetCharacterForm
	return
      }
      set CurrentCharacter(filename) {new.character}
#	           name player race class alignment sex age
#		   S ES 
#		   I 
#                  W
#		   D 
#                  C 
#                  CH 
#                  l hs 
#                  hd 
#                  md com 
      set CurrentCharacter(handle)  [Character {} {} {Human} {npc} {} {} 0  [lindex $abilities 0] 0  [lindex $abilities 1]  [lindex $abilities 2]  [lindex $abilities 3]  [lindex $abilities 4]  [lindex $abilities 5]  1 [lindex $abilities 7]  [lindex $abilities 6]  [lindex $abilities 8]  {}]
      set CurrentCharacter(isdirty) 1
      ResetCharacterForm
      wm title . "Character: [TrimPathPrefix $CurrentCharacter(filename)]"
    }
    {MonsterFrame} {
      global CurrentMonster
      if {$CurrentMonster(handle) != {}} {
	if {$CurrentMonster(isdirty)} {
	  set answer [YesNoBox "Modified monster data in monster frame, lose it?"]
	  if {!$answer} {
	    return
	  }
	}
	$CurrentMonster(handle) delete
	set CurrentMonster(handle) [Monster]
	set CurrentMonster(isdirty) 0
	set CurrentMonster(filename) {new.monster}
	ResetMonsterForm
      }
      wm title . "Monster: [TrimPathPrefix $CurrentMonster(filename)]"
    }
    {MasterFrame} {
      MasterNewFrame
      global MasterMode 
      global CurrentMasterDungeon
      global CurrentMasterGame
      if {$CurrentMasterDungeon(handle) != {}} {
	if {$MasterMode == "Build"} {
	  [SN MasterCreateSubMode] configure -state normal
          [SN MasterMonstersSubModeFrameCreateMonster] configure -state normal
	  [SN MasterMonstersSubModeFrameCreateNPC] configure -state normal
	  foreach b [winfo children [SN MasterSpaceButtons]] {
	    $b configure -state normal
	  }
	  foreach m {Monsters Other Treasure Tricks} {
	    foreach b {Add Remove} {
	      [SN [join [list Master $m SubModeFrame $b] ""]] configure -state normal
	    }
	  }
	  [SN MasterExitsSubModeFrame].buttons.install configure -state normal
	  [SN MasterExitsSubModeFrame].buttons.reset configure -state normal
	}
	[SN MasterExitsSubMode] configure -state normal
	[SN MasterMonstersSubMode] configure -state normal
	[SN MasterOtherSubMode] configure -state normal
	[SN MasterTreasureSubMode] configure -state normal
	[SN MasterTricksSubMode] configure -state normal
      }
      if {$CurrentMasterGame(handle) != {}} {
	if {$MasterMode == "Play" } {
	  [SN MasterMeleeSubMode] configure -state normal
	}
      }
      if {$MasterMode == "Build"} {
	wm title . "Master: [TrimPathPrefix $CurrentMasterDungeon(filename)]"
      } else {
	wm title . "Master: [TrimPathPrefix $CurrentMasterGame(filename)]"
      }
    }
  }
}


# Procedure: OpenFrame
proc OpenFrame {} {
  global CurrentFrame
  case $CurrentFrame in {
    {CharacterFrame} {
      global CurrentCharacter
      if {$CurrentCharacter(handle) != {}} {
	if {$CurrentCharacter(isdirty)} {
	  set answer [YesNoBox "Modified character data in character frame, lose it?"]
	  if {!$answer} {
	    return
	  }
	}
	$CurrentCharacter(handle) delete
	set CurrentCharacter(handle) {}
	set CurrentCharacter(isdirty) 0
	set CurrentCharacter(filename) {}
	ResetCharacterForm
      }
      global fsBox
      set fsBox(showPixmap) 0
      set newfile [FSBox "Read character data from: " new.character]
      if {$newfile == ""} {
	return
      }
      if {![file exists $newfile]} {
	return
      }
      set CurrentCharacter(filename) $newfile
      set CurrentCharacter(handle)  [Character]
      set CurrentCharacter(isdirty) 0
      $CurrentCharacter(handle) read $newfile
      ResetCharacterForm
      wm title . "Character: [TrimPathPrefix $CurrentCharacter(filename)]"
    }
    {MonsterFrame} {
      global CurrentMonster
      if {$CurrentMonster(handle) != {}} {
	if {$CurrentMonster(isdirty)} {
	  set answer [YesNoBox "Modified monster data in monster frame, lose it?"]
	  if {!$answer} {
	    return
	  }
	}
	$CurrentMonster(handle) delete
	set CurrentMonster(handle) {}
	set CurrentMonster(isdirty) 0
	set CurrentMonster(filename) {}
	ResetMonsterForm
      }
      global fsBox
      set fsBox(showPixmap) 0
      set newfile [FSBox "Read monster data from: " new.Monster]
      if {$newfile == ""} {
	return
      }
      if {![file exists $newfile]} {
	return
      }
      set CurrentMonster(filename) $newfile
      set CurrentMonster(handle)  [Monster]
      set CurrentMonster(isdirty) 0
      $CurrentMonster(handle) read $newfile
      ResetMonsterForm
      wm title . "Monster: [TrimPathPrefix $CurrentMonster(filename)]"
    }
    {MasterFrame} {
      MasterOpenFrame
      global MasterMode 
      global CurrentMasterDungeon
      global CurrentMasterGame
      if {$CurrentMasterDungeon(handle) != {}} {
	if {$MasterMode == "Build"} {
	  [SN MasterCreateSubMode] configure -state normal
          [SN MasterMonstersSubModeFrameCreateMonster] configure -state normal
	  [SN MasterMonstersSubModeFrameCreateNPC] configure -state normal
	  foreach b [winfo children [SN MasterSpaceButtons]] {
	    $b configure -state normal
	  }
	  foreach m {Monsters Other Treasure Tricks} {
	    foreach b {Add Remove} {
	      [SN [join [list Master $m SubModeFrame $b] ""]] configure -state normal
	    }
	  }	
	  [SN MasterExitsSubModeFrame].buttons.install configure -state normal
	  [SN MasterExitsSubModeFrame].buttons.reset configure -state normal
	}
	[SN MasterMonstersSubMode] configure -state normal
	[SN MasterOtherSubMode] configure -state normal
	[SN MasterTreasureSubMode] configure -state normal
	[SN MasterTricksSubMode] configure -state normal
	[SN MasterExitsSubMode] configure -state normal
      }
      if {$CurrentMasterGame(handle) != {}} {
	if {$MasterMode == "Play" } {
	  [SN MasterMeleeSubMode] configure -state normal
	}
      }
      if {$MasterMode == "Build"} {
	wm title . "Master: [TrimPathPrefix $CurrentMasterDungeon(filename)]"
      } else {
	wm title . "Master: [TrimPathPrefix $CurrentMasterGame(filename)]"
      }
    }
  }
}


# Procedure: OptionButtonGet
proc OptionButtonGet { widget} {

  if {"[winfo class $widget.value]" == "Label"} {
    return [lindex [$widget.value config -text] 4]
  } {
    if {"[winfo class $widget.value]" == "Entry"} {
      return [$widget.value get]
    }
  }
}


# Procedure: OptionButtonSet
proc OptionButtonSet { widget} {

  if {"[winfo class $widget.value]" == "Label"} {
    $widget.value config -text [lindex [$widget.menubutton2.m entryconfig [$widget.menubutton2.m index active] -label] 4]
  } {
    if {"[winfo class $widget.value]" == "Entry"} {
      $widget.value delete 0 end
      $widget.value insert 0 [lindex [$widget.menubutton2.m entryconfig [$widget.menubutton2.m index active] -label] 4]
    }
  }
}


# Procedure: PopFrame
proc PopFrame { newframe} {
  global CurrentFrame
  if {$CurrentFrame != {}} {
    pack forget [SN $CurrentFrame]
  }
  pack append .  .frame0 {top frame center fillx} [SN $newframe] {top frame center}
  set CurrentFrame $newframe
  case $CurrentFrame in {
    {CharacterFrame} {
      global CurrentCharacter
      if {$CurrentCharacter(handle) == {}} {
	set CurrentCharacter(handle) [Character]
	set CurrentCharacter(isdirty) 0
	set CurrentCharacter(filename) {new.character}
	ResetCharacterForm
      }
      wm title . "Character: [TrimPathPrefix $CurrentCharacter(filename)]"
      focus [SN CharacterStrength]
    }
    {MonsterFrame} {
      global CurrentMonster
      if {$CurrentMonster(handle) == {}} {
        set CurrentMonster(handle) [Monster]
        set CurrentMonster(isdirty) 0
        set CurrentMonster(filename) {new.monster}
        ResetMonsterForm
      }
      wm title . "Monster: [TrimPathPrefix $CurrentMonster(filename)]"
      focus [SN MonsterName]
    }
    {MasterFrame} {
      global {CurrentMasterDungeon}
      global {CurrentMasterGame}
      global {MasterMode}
      if {$CurrentMasterDungeon(handle) != {}} {
	if {$MasterMode == "Build"} {
	  [SN MasterCreateSubMode] configure -state normal
          [SN MasterMonstersSubModeFrameCreateMonster] configure -state normal
	  [SN MasterMonstersSubModeFrameCreateNPC] configure -state normal
	  foreach m {Monsters Other Treasure Tricks} {
	    foreach b {Add Remove} {
	      [SN [join [list Master $m SubModeFrame $b] ""]] configure -state normal
	    }
	  }	
	}
	[SN MasterMonstersSubMode] configure -state normal
	[SN MasterOtherSubMode] configure -state normal
	[SN MasterTreasureSubMode] configure -state normal
	[SN MasterTricksSubMode] configure -state normal
	[SN MasterExitsSubMode] configure -state normal
      }
      if {$CurrentMasterGame(handle) != {}} {
	if {$MasterMode == "Play" } {
	  [SN MasterMeleeSubMode] configure -state normal
	}
      }
      if {$MasterMode == "Build"} {
	wm title . "Master: [TrimPathPrefix $CurrentMasterDungeon(filename)]"
      } else {
	wm title . "Master: [TrimPathPrefix $CurrentMasterGame(filename)]"
      }
      focus [SN MasterLocationLevel]
    }
  }
}


# Procedure: SaveFrame
proc SaveFrame {} {
  global CurrentFrame
  case $CurrentFrame in {
    {CharacterFrame} {
      global CurrentCharacter
      if {$CurrentCharacter(handle) != {}} {
	UpdateCharacter
	$CurrentCharacter(handle) write $CurrentCharacter(filename)
	set CurrentCharacter(isdirty) 0
      }
    }
    {MonsterFrame} {
      global CurrentMonster
      if {$CurrentMonster(handle) != {}} {
	UpdateMonster
	$CurrentMonster(handle) write $CurrentMonster(filename)
	set CurrentMonster(isdirty) 0
      }
    }
    {MasterFrame} {
      MasterSaveFrame
      global MasterMode 
      global CurrentMasterDungeon
      global CurrentMasterGame
    }
  }
}


# Procedure: SaveFrameAs
proc SaveFrameAs {} {
  global CurrentFrame
  case $CurrentFrame in {
    {CharacterFrame} {
      global CurrentCharacter
      if {$CurrentCharacter(handle) != {}} {
	UpdateCharacter
	global fsBox
	set fsBox(showPixmap) 0
	set newfilename [FSBox "Save character in file: " $CurrentCharacter(filename)]
	if {$newfilename == ""} {
	  return
	}
	set CurrentCharacter(filename) $newfilename
	$CurrentCharacter(handle) write $CurrentCharacter(filename)
	set CurrentCharacter(isdirty) 0
        wm title . "Character: [TrimPathPrefix $CurrentCharacter(filename)]"
      }
    }
    {MonsterFrame} {
      global CurrentMonster
      if {$CurrentMonster(handle) != {}} {
	global fsBox
	set fsBox(showPixmap) 0
	UpdateMonster
	set newfilename [FSBox "Save monster in file: " $CurrentMonster(filename)]
	if {$newfilename == ""} {
	  return
	}
	set CurrentMonster(filename) $newfilename
	$CurrentMonster(handle) write $CurrentMonster(filename)
	set CurrentMonster(isdirty) 0
        wm title . "Monster: [TrimPathPrefix $CurrentMonster(filename)]"
      }
    }
    {MasterFrame} {
      MasterSaveFrameAs
      global MasterMode 
      global CurrentMasterDungeon
      global CurrentMasterGame
      if {$MasterMode == "Build"} {
	wm title . "Master: [TrimPathPrefix $CurrentMasterDungeon(filename)]"
      } else {
	wm title . "Master: [TrimPathPrefix $CurrentMasterGame(filename)]"
      }
    }
  }
}


# Procedure: TrimPathPrefix
proc TrimPathPrefix { path} {
  set pwd "[pwd]/"
  if {[string first $pwd $path] == 0} {
    set path "[string range $path [string length $pwd] end]"
  }
  if {[string range $path 0 2] == {../}} {
    set pwd [pwd]
    while {[string range $path 0 2] == {../} && $pwd != {/}} {
      set pwd [file dirname $pwd]
      set path [string range $path 3 end]
    }
    if {$pwd != [pwd]} {
      set path "$pwd/$path"
    }
  }
  if {[string index $path 0] != {/}} {
    set path "./$path"
  }
  return $path
}


# Procedure: auto_load_ouster_index
proc auto_load_ouster_index { fn} {
    global auto_index
    set dir [file dirname $fn]

    if [catch {set f [open $dir/tclIndex]}] {
        return
    }
    set error [catch {
        set id [gets $f]
        if {$id == "# Tcl autoload index file, version 2.0"} {
            eval [read $f]
        } elseif {$id == "# Tcl autoload index file: each line identifies a Tcl"} {
            while {[gets $f line] >= 0} {
                if {([string index $line 0] == "#")
                        || ([llength $line] != 2)} {
                    continue
                }
                set name [lindex $line 0]
                if {![info exists auto_index($name)]} {
                    set auto_index($name) "source $dir/[lindex $line 1]"
                }
            }
        } else {
            error "$dir/tclIndex isn't a proper Tcl index file"
        }
    } msg]
    if {$f != ""} {
        close $f
    }
    if $error {
        global errorInfo errorCode
        error $msg $errorInfo $errorCode
    }
}

# Procedude: MasterExitSpaceBindBoxes
proc MasterExitSpaceBindBoxes {} {
  global MasterExitPositionList
  global MasterExitSpace
  set color [lindex [[SN MasterExitsSubModeSpace] configure -background] 4]
  foreach e $MasterExitPositionList {
    if {[$MasterExitSpace exit [lindex $e 0]] == "None"} {
      set xfTmpTag [[SN MasterExitsSubModeSpace] create rectangle \
	  [lindex $e 1] [lindex $e 2] [expr [lindex $e 1] + 16] \
	  [expr [lindex $e 2] + 16] -fill $color]
    } else {
      set xfTmpTag [[SN MasterExitsSubModeSpace] find overlapping \
		    [lindex $e 1] [lindex $e 2] [expr [lindex $e 1] + 16] \
		    [expr [lindex $e 2] + 16]]
    }
    [SN MasterExitsSubModeSpace] bind $xfTmpTag <B1-Motion> \
	"MenuPopupHandle [SN MasterExitsSubModeFrame].[lindex $e 0] %W %X %Y"
    [SN MasterExitsSubModeSpace] bind $xfTmpTag <Button-1> \
	"[SN MasterExitsSubModeFrame].[lindex $e 0] post %X %Y"
    [SN MasterExitsSubModeSpace] bind $xfTmpTag <ButtonRelease-1> \
	"[SN MasterExitsSubModeFrame].[lindex $e 0] invoke active; [SN MasterExitsSubModeFrame].[lindex $e 0] unpost"
  }
}

# Internal procedures


# Procedure: MenuPopupAdd
if {"[info procs MenuPopupAdd]" == ""} {
proc MenuPopupAdd { xfW xfButton xfMenu {xfModifier ""} {xfCanvasTag ""}} {
# xf ignore me 7
# the popup menu handling is from (I already gave up with popup handling :-):
#
# Copyright 1991,1992 by James Noble.
# Everyone is granted permission to copy, modify and redistribute.
# This notice must be preserved on all copies or derivates.
#
##########
# Procedure: MenuPopupAdd
# Description: attach a popup menu to widget
# Arguments: xfW - the widget
#            xfButton - the button we use
#            xfMenu - the menu to attach
#            {xfModifier} - a optional modifier
#            {xfCanvasTag} - a canvas tagOrId
# Returns: none
# Sideeffects: none
##########

  if {"$xfModifier" != ""} {
    set xfPressModifier "$xfModifier-"
    set xfMoveModifier "$xfModifier-"
    set xfReleaseModifier "Any-"
  } {
    set xfPressModifier ""
    set xfMoveModifier ""
    set xfReleaseModifier ""
  }

  if {"$xfCanvasTag" == ""} {
    if {[catch "bind $xfW \"<${xfPressModifier}ButtonPress-$xfButton>\"  \"$xfMenu post %X %Y\"" xfResult]} {
      if {"[info commands XFProcError]" != ""} {
        XFProcError "$xfResult"
      } {
        puts stdout "$xfResult"
      }
      return
    }
    if {[catch "bind $xfW \"<${xfMoveModifier}B$xfButton-Motion>\"  \"MenuPopupHandle $xfMenu %W %X %Y\"" xfResult]} {
      if {"[info commands XFProcError]" != ""} {
        XFProcError "$xfResult"
      } {
        puts stdout "$xfResult"
      }
      return
    }
    # we need these to counteract the effects of passive grabs :-(
    if {[catch "bind $xfW \"<${xfReleaseModifier}ButtonRelease-$xfButton>\"  \"$xfMenu invoke active; $xfMenu unpost\"" xfResult]} {
      if {"[info commands XFProcError]" != ""} {
        XFProcError "$xfResult"
      } {
        puts stdout "$xfResult"
      }
      return
    }
  } {
    if {[catch "$xfW bind $xfCanvasTag \"<${xfPressModifier}ButtonPress-$xfButton>\"  \"$xfMenu post %X %Y\"" xfResult]} {
      if {"[info commands XFProcError]" != ""} {
        XFProcError "$xfResult"
      } {
        puts stdout "$xfResult"
      }
      return
    }
    if {[catch "$xfW bind $xfCanvasTag \"<${xfMoveModifier}B$xfButton-Motion>\"  \"MenuPopupHandle $xfMenu %W %X %Y\"" xfResult]} {
      if {"[info commands XFProcError]" != ""} {
        XFProcError "$xfResult"
      } {
        puts stdout "$xfResult"
      }
      return
    }
    # we need these to counteract the effects of passive grabs :-(
    if {[catch "$xfW bind $xfCanvasTag \"<${xfReleaseModifier}ButtonRelease-$xfButton>\"  \"$xfMenu invoke active; $xfMenu unpost\"" xfResult]} {
      if {"[info commands XFProcError]" != ""} {
        XFProcError "$xfResult"
      } {
        puts stdout "$xfResult"
      }
      return
    }
  }
}
}


# Procedure: MenuPopupHandle
if {"[info procs MenuPopupHandle]" == ""} {
proc MenuPopupHandle { xfMenu xfW xfX xfY} {
# xf ignore me 7
##########
# Procedure: MenuPopupHandle
# Description: handle the popup menus
# Arguments: xfMenu - the menu to attach
#            xfW - the widget
#            xfX - the root x coordinate
#            xfY - the root x coordinate
# Returns: none
# Sideeffects: none
##########

  if {"[info commands $xfMenu]" != "" && [winfo ismapped $xfMenu]} {
    set xfPopMinX [winfo rootx $xfMenu]
    set xfPopMaxX [expr $xfPopMinX+[winfo width $xfMenu]]
    if {($xfX >= $xfPopMinX) &&  ($xfX <= $xfPopMaxX)} {
      $xfMenu activate @[expr $xfY-[winfo rooty $xfMenu]]
    } {
      $xfMenu activate none
    }
  }
}
}


# Procedure: NoFunction
if {"[info procs NoFunction]" == ""} {
proc NoFunction { args} {
# xf ignore me 7
##########
# Procedure: NoFunction
# Description: do nothing (especially with scales and scrollbars)
# Arguments: args - a number of ignored parameters
# Returns: none
# Sideeffects: none
##########
}
}


# Procedure: SN
if {"[info procs SN]" == ""} {
proc SN { {xfName ""}} {
# xf ignore me 7
##########
# Procedure: SN
# Description: map a symbolic name to the widget path
# Arguments: xfName
# Returns: the symbolic name
# Sideeffects: none
##########

  SymbolicName $xfName
}
}


# Procedure: SymbolicName
if {"[info procs SymbolicName]" == ""} {
proc SymbolicName { {xfName ""}} {
# xf ignore me 7
##########
# Procedure: SymbolicName
# Description: map a symbolic name to the widget path
# Arguments: xfName
# Returns: the symbolic name
# Sideeffects: none
##########

  global symbolicName

  if {"$xfName" != ""} {
    set xfArrayName ""
    append xfArrayName symbolicName ( $xfName )
    if {![catch "set \"$xfArrayName\"" xfValue]} {
      return $xfValue
    } {
      if {"[info commands XFProcError]" != ""} {
        XFProcError "Unknown symbolic name:\n$xfName"
      } {
        puts stderr "XF error: unknown symbolic name:\n$xfName"
      }
    }
  }
  return ""
}
}



# module load procedure
proc XFLocalIncludeModule {{moduleName ""}} {
  global env
  global xfLoadInfo
  global xfLoadPath
  global xfStatus

  foreach p [split $xfLoadPath :] {
    if {[file exists "$p/$moduleName"]} {
      if {![file readable "$p/$moduleName"]} {
        puts stderr "Cannot read $p/$moduleName (permission denied)"
        continue
      }
      if {$xfLoadInfo} {
        puts stdout "Loading $p/$moduleName..."
      }
      source "$p/$moduleName"
      return 1
    }
    # first see if we have a load command
    if {[info exists env(XF_VERSION_SHOW)]} {
      set xfCommand $env(XF_VERSION_SHOW)
      regsub -all {\$xfFileName} $xfCommand $p/$moduleName xfCommand
      if {$xfLoadInfo} {
        puts stdout "Loading $p/$moduleName...($xfCommand)"
      }
      if {[catch "$xfCommand" contents]} {
        continue
      } {
        eval $contents
        return 1
      }
    }
    # are we able to load versions from wish ?
    if {[catch "afbind $p/$moduleName" aso]} {
      # try to use xf version load command
      global xfVersion
      if {[info exists xfVersion(showDefault)]} {
        set xfCommand $xfVersion(showDefault)
      } {
	# our last hope
        set xfCommand "vcat -q $p/$moduleName"
      }
      regsub -all {\$xfFileName} $xfCommand $p/$moduleName xfCommand
      if {$xfLoadInfo} {
        puts stdout "Loading $p/$moduleName...($xfCommand)"
      }
      if {[catch "$xfCommand" contents]} {
        continue
      } {
        eval $contents
        return 1
      }
    } {
      # yes we can load versions directly
      if {[catch "$aso open r" inFile]} {
        puts stderr "Cannot open $p/[$aso attr af_bound] (permission denied)"
        continue
      }
      if {$xfLoadInfo} {
        puts stdout "Loading $p/[$aso attr af_bound]..."
      }
      if {[catch "read \{$inFile\}" contents]} {
        puts stderr "Cannot read $p/[$aso attr af_bound] (permission denied)"
        close $inFile
        continue
      }
      close $inFile
      eval $contents
      return 1
    }
  }
  puts stderr "Cannot load module $moduleName -- check your xf load path"
  destroy .
  exit
}

# application parsing procedure
proc XFLocalParseAppDefs {xfAppDefFile} {
  global xfAppDefaults

  # basically from: Michael Moore
  if {[file exists $xfAppDefFile] &&
      [file readable $xfAppDefFile] &&
      "[file type $xfAppDefFile]" == "link"} {
    catch "file type $xfAppDefFile" xfType
    while {"$xfType" == "link"} {
      if {[catch "file readlink $xfAppDefFile" xfAppDefFile]} {
        return
      }
      catch "file type $xfAppDefFile" xfType
    }
  }
  if {!("$xfAppDefFile" != "" &&
        [file exists $xfAppDefFile] &&
        [file readable $xfAppDefFile] &&
        "[file type $xfAppDefFile]" == "file")} {
    return
  }
  if {![catch "open $xfAppDefFile r" xfResult]} {
    set xfAppFileContents [read $xfResult]
    close $xfResult
    foreach line [split $xfAppFileContents "\n"] {
      # backup indicates how far to backup.  It applies to the
      # situation where a resource name ends in . and when it
      # ends in *.  In the second case you want to keep the *
      # in the widget name for pattern matching, but you want
      # to get rid of the . if it is the end of the name. 
      set backup -2  
      set line [string trim $line]
      if {[string index $line 0] == "#" || "$line" == ""} {
        # skip comments and empty lines
        continue
      }
      set list [split $line ":"]
      set resource [string trim [lindex $list 0]]
      set i [string last "." $resource]
      set j [string last "*" $resource]
      if {$j > $i} { 
        set i $j
        set backup -1
      }
      incr i
      set name [string range $resource $i end]
      incr i $backup
      set widname [string range $resource 0 $i]
      set value [string trim [lindex $list 1]]
      if {"$widname" != "" && "$widname" != "*"} {
        # insert the widget and resourcename to the application
        # defaults list.
        set xfAppDefaults($widname:[string tolower $name]) $value
      }
    }
  }
}

# application loading procedure
proc XFLocalLoadAppDefs {xfClasses {xfPriority "startupFile"} {xfAppDefFile ""}} {
  global env

  if {"$xfAppDefFile" == ""} {
    set xfFileList ""
    if {[info exists env(XUSERFILESEARCHPATH)]} {
      append xfFileList [split $env(XUSERFILESEARCHPATH) :]
    }
    if {[info exists env(XAPPLRESDIR)]} {
      append xfFileList [split $env(XAPPLRESDIR) :]
    }
    if {[info exists env(XFILESEARCHPATH)]} {
      append xfFileList [split $env(XFILESEARCHPATH) :]
    }
    append xfFileList " /usr/lib/X11/app-defaults"
    append xfFileList " /usr/X11/lib/X11/app-defaults"

    foreach xfCounter1 $xfClasses {
      foreach xfCounter2 $xfFileList {
        set xfPathName $xfCounter2
        if {[regsub -all "%N" "$xfPathName" "$xfCounter1" xfResult]} {
          set xfPathName $xfResult
        }
        if {[regsub -all "%T" "$xfPathName" "app-defaults" xfResult]} {
          set xfPathName $xfResult
        }
        if {[regsub -all "%S" "$xfPathName" "" xfResult]} {
          set xfPathName $xfResult
        }
        if {[regsub -all "%C" "$xfPathName" "" xfResult]} {
          set xfPathName $xfResult
        }
        if {[file exists $xfPathName] &&
            [file readable $xfPathName] &&
            ("[file type $xfPathName]" == "file" ||
             "[file type $xfPathName]" == "link")} {
          catch "option readfile $xfPathName $xfPriority"
          if {"[info commands XFParseAppDefs]" != ""} {
            XFParseAppDefs $xfPathName
          } {
            if {"[info commands XFLocalParseAppDefs]" != ""} {
              XFLocalParseAppDefs $xfPathName
            }
          }
        } {
          if {[file exists $xfCounter2/$xfCounter1] &&
              [file readable $xfCounter2/$xfCounter1] &&
              ("[file type $xfCounter2/$xfCounter1]" == "file" ||
               "[file type $xfCounter2/$xfCounter1]" == "link")} {
            catch "option readfile $xfCounter2/$xfCounter1 $xfPriority"
            if {"[info commands XFParseAppDefs]" != ""} {
              XFParseAppDefs $xfCounter2/$xfCounter1
            } {
              if {"[info commands XFLocalParseAppDefs]" != ""} {
                XFLocalParseAppDefs $xfCounter2/$xfCounter1
              }
            }
          }
        }
      }
    }
  } {
    # load a specific application defaults file
    if {[file exists $xfAppDefFile] &&
        [file readable $xfAppDefFile] &&
        ("[file type $xfAppDefFile]" == "file" ||
         "[file type $xfAppDefFile]" == "link")} {
      catch "option readfile $xfAppDefFile $xfPriority"
      if {"[info commands XFParseAppDefs]" != ""} {
        XFParseAppDefs $xfAppDefFile
      } {
        if {"[info commands XFLocalParseAppDefs]" != ""} {
          XFLocalParseAppDefs $xfAppDefFile
        }
      }
    }
  }
}

# application setting procedure
proc XFLocalSetAppDefs {{xfWidgetPath "."}} {
  global xfAppDefaults

  if {![info exists xfAppDefaults]} {
    return
  }
  foreach xfCounter [array names xfAppDefaults] {
    if {[string match "${xfWidgetPath}*" $xfCounter]} {
      set widname [string range $xfCounter 0 [expr [string first : $xfCounter]-1]]
      set name [string range $xfCounter [expr [string first : $xfCounter]+1] end]
      # Now lets see how many tcl commands match the name
      # pattern specified.
      set widlist [info command $widname]
      if {"$widlist" != ""} {
        foreach widget $widlist {
          # make sure this command is a widget.
          if {![catch "winfo id $widget"]} {
            catch "$widget configure -[string tolower $name] $xfAppDefaults($xfCounter)" 
          }
        }
      }
    }
  }
}



# end source
proc EndSrc {} {
  if {![winfo exists .xfLoading]} {
    EMTextBind Text
    bind Entry <ButtonRelease-2> {%W insert insert "[GetSelection]"}
    bind Entry <Help> {PopupHelpWidget [winfo containing %X %Y]}
    bind Text <Help> {PopupHelpWidget [winfo containing %X %Y]}
    bind all <Help> {PopupHelpWidget [winfo containing %X %Y]}
  }
  global argc
  global argv
  set frame {MasterFrame}
  for {set counter 0} {$counter < $argc} {incr counter 1} {
    switch -exact -- [string tolower [lindex $argv $counter]] {
      -frame {
	incr counter 1
	switch -glob -- [string tolower [lindex $argv $counter]] {
	  ma* {set frame MasterFrame}
	  mo* {set frame MonsterFrame}
	  c*  {set frame CharacterFrame}
	  default "error \"bad value for -frame - [lindex $argv $counter]\""
	}
      }
      default "error \"bad option: [lindex $argv $counter]\""
    }
  }
  PopFrame $frame
  update idletasks
  global alertBox
  set alertBox(justify) left
  AlertBox {Role Playing DataBase Version 1.0, Copyright (C) 1995 Robert Heller
Role Playing DataBase comes with ABSOLUTELY NO WARRANTY; for details
select Warranty under the Help menu.
This is free software, and you are welcome to redistribute it
under certain conditions; select Copying uner the help menu
for details.} "" {500x150}
#  bind $alertBox(toplevelName) <Visibility> {raise %W}
}

if {"[info procs XFShowHelp]" != ""} {
  XFLocalIncludeModule CHARFunctions
}
if {"[info procs XFShowHelp]" != ""} {
  XFLocalIncludeModule CLFunctions
}
XFLocalIncludeModule EMFunctions
if {"[info procs XFShowHelp]" != ""} {
  XFLocalIncludeModule MASTERFunctions
}
if {"[info procs XFShowHelp]" != ""} {
  XFLocalIncludeModule MONSTFunctions
}
if {"[info procs XFShowHelp]" != ""} {
  XFLocalIncludeModule PrintFunctions
}
if {"[info procs XFShowHelp]" != ""} {
  XFLocalIncludeModule HELPFunctions
}
XFLocalIncludeModule SYSFunctions

# prepare auto loading
global auto_path
global tk_library
global xfLoadPath
set auto_path "[split $xfLoadPath :] $tk_library [info library]"

# initialize global variables
proc InitGlobals {} {
  global colorBox
  set colorBox(activeBackground) ""
  set colorBox(activeForeground) ""
  set colorBox(background) ""
  set colorBox(font) ""
  set colorBox(foreground) ""
  set colorBox(palette) {white black gray50 blue red green yellow orange}
  set colorBox(scrollActiveForeground) ""
  set colorBox(scrollBackground) ""
  set colorBox(scrollForeground) ""
  set colorBox(scrollSide) left
  set colorBox(colorName) ""
  set colorBox(type) rgb
  set colorBox(paletteNr) 0
  global {CurrentCharacter}
  set {CurrentCharacter(filename)} {}
  set {CurrentCharacter(handle)} {}
  set {CurrentCharacter(isdirty)} {0}
  global {CurrentFrame}
  set {CurrentFrame} {MasterFrame}
  global {CurrentMasterDungeon}
  set {CurrentMasterDungeon(filename)} {}
  set {CurrentMasterDungeon(handle)} {}
  set {CurrentMasterDungeon(isdirty)} {0}
  set {CurrentMasterDungeon(level)} {0}
  set {CurrentMasterDungeon(x)} {0}
  set {CurrentMasterDungeon(y)} {0}
  global {CurrentMasterGame}
  set {CurrentMasterGame(filename)} {}
  set {CurrentMasterGame(handle)} {}
  set {CurrentMasterGame(isdirty)} {0}
  global {CurrentMonster}
  set {CurrentMonster(filename)} {}
  set {CurrentMonster(handle)} {}
  set {CurrentMonster(isdirty)} {0}
  global {EMCutBuffer}
  set {EMCutBuffer} {}
  global {EMCutBufferFlag}
  set {EMCutBufferFlag} {0}
  global {EMMark}
  set {EMMark} {}
  global {Ident}
  set {Ident} {$Id: RolePlayingDB,v 1.38 1995/08/01 02:24:30 heller Exp $}
  global {MasterCreateTrickTreasureIsUnique}
  set {MasterCreateTrickTreasureIsUnique} {0}
  global {MasterExitSpace}
  set {MasterExitSpace} [Space]
  global {MasterExitPositionList}
  set {MasterExitPositionList} {{north 42 0} {northeast 84 0} {east 84 42}
				{southeast 84 84} {south 42 84}
				{southwest 0 84} {west 0 42} {northwest 0 0}
				{up 34 42} {down 50 42}}
  global {MasterMode}
  set {MasterMode} {Build}
  global {MasterSubSubMode}
  set {MasterSubSubMode} {Monsters}
  global {ModificationHistory}
  set {ModificationHistory} {
  $Log: RolePlayingDB,v $
# Revision 1.38  1995/08/01  02:24:30  heller
# Fix access to copying and Warranty message files
#
# Revision 1.37  1995/07/23  00:18:32  heller
# Fix load path hackery
#
# Revision 1.36  1995/07/22  21:59:27  heller
# Add StartupSrc and command line parsing to EndSrc
#
# Revision 1.35  1995/07/22  21:26:27  heller
# Remove XF loading of tkinfo
#
# Revision 1.34  1995/07/22  21:22:38  heller
# Fix typo: HelpFunctions => HELPFunctions
#
# Revision 1.33  1995/07/11  00:01:50  heller
# Remove garbage symbolic name
#
# Revision 1.32  1995/07/10  22:38:52  heller
# Add in <Help> key binding
#
# Revision 1.31  1995/07/09  22:07:49  heller
# Updated Help handling
#
# Revision 1.30  1995/07/03  21:02:06  heller
# Fix Dice usage
#
# Revision 1.29  1995/07/03  18:24:02  heller
# Whole lot of changes:
# added Encumbrences buttons and functions
# added space exit frame handling
# completed Melee handling
# assorted fixes and adjustments to the GUI
#
# Revision 1.28  1995/06/18  23:46:46  heller
# Extended Center button to be a menu button for Up and Down exits
# Added base bindings (return and tab keys) to entries
# changed History box to a text box (with scrollbar)
#
# Revision 1.27  1995/06/17  21:51:31  heller
# Changed to use internal bitmaps for buttons
#
# Revision 1.26  1995/04/25  16:01:22  heller
# Add buttons for creating monsters and npcs
#
# Revision 1.25  1995/04/10  23:52:30  heller
# Add in proper button state handling when there is no dungeon and/or no
# game state loaded.
#
# Revision 1.24  1995/04/09  18:15:49  heller
# Added create trick/treasure form
#
# Revision 1.23  1995/04/05  22:36:19  heller
# Finish first pass at Describe hack
#
# Revision 1.22  1995/04/05  21:32:25  heller
# Update canvas bindings.
#
# Revision 1.21  1995/03/18  19:51:50  heller
# Dice handle changes
#
# Revision 1.20  1995/03/17  06:16:48  heller
# Add missing character slots: Alignment, Sex, and age
#
# Revision 1.19  1995/03/14  22:46:33  heller
# Update for handle usage
# Fix minor bug in PopFrame
# Minor changes to title handling
#
# Revision 1.18  1995/03/12  00:29:28  heller
# Handle initial form state (implicit "new")
# Update title handling to show current filename
#
# Revision 1.17  1995/03/11  18:39:35  heller
# Add add/remove/view functions.
# Complete Master{Add/Remove/View}Monster
#
# Revision 1.16  1995/03/09  00:40:03  heller
# Add in MarchCanvas hacking
# and make sure fsBox(showPixmap) is sane
#
# Revision 1.15  1995/03/07  16:13:38  heller
# Added code for Add, View, and Remove character
# added handling of Add and Remove buttons during mode change
# added generic view buttons
#
# Revision 1.14  1995/03/07  02:15:32  heller
# Updated Master Form Functions and SNs
#
# Revision 1.13  1995/03/05  22:22:34  heller
# Added to Master Form (Melee)
# Modularized Program
#
# Revision 1.12  1995/03/05  02:11:11  heller
# Completed Monster Form
#
# Revision 1.11  1995/03/04  04:49:49  heller
# More Goodies for the MasterFrame
#
# Revision 1.10  1995/03/03  00:15:58  heller
# Minor update to master form
# (Allow for interchangable subwindow)
#
# Revision 1.9  1995/03/01  23:56:06  heller
# Add in master GUI form
#
# Revision 1.8  1995/03/01  00:46:16  heller
# Add in name!
#
# Revision 1.7  1995/02/28  22:54:54  heller
# Monster form layout
#
# Revision 1.6  1995/02/28  06:22:11  heller
# Fix Title handling
#
# Revision 1.5  1995/02/28  06:08:18  heller
# Complete Character Frame functions
#
# Revision 1.4  1995/02/27  00:25:45  heller
# Most of Character Frame is done.
#
# Revision 1.3  1995/02/25  17:14:20  heller
# add in History help
#
  }
  global {MonsterHitType}
  set {MonsterHitType} {HitDice}
  global {Moving}
  set {Moving(Canvas)} {}
  set {Moving(Index)} {}
  set {Moving(X)} {}
  set {Moving(Y)} {}
  global {OutputDevice}
  set {OutputDevice} {Printer}
  global {RollResults}
  set {RollResults(button)} {}
  set {RollResults(chrisma)} {}
  set {RollResults(constitution)} {}
  set {RollResults(dexterity)} {}
  set {RollResults(hitds)} {}
  set {RollResults(intelligence)} {}
  set {RollResults(maxdie)} {}
  set {RollResults(nhitd)} {}
  set {RollResults(strength)} {}
  set {RollResults(wisdom)} {}
  global {alertBox}
  set {alertBox(activeBackground)} {}
  set {alertBox(activeForeground)} {}
  set {alertBox(after)} {0}
  set {alertBox(anchor)} {nw}
  set {alertBox(background)} {}
  set {alertBox(button)} {0}
  set {alertBox(font)} {}
  set {alertBox(foreground)} {}
  set {alertBox(justify)} {left}
  set {alertBox(toplevelName)} {.alertBox}
  global {MasterMeleeAttacker}
  set {MasterMeleeAttacker} {}
  global {MasterMeleeDefender}
  set {MasterMeleeDefender} {}
  global {es}
  set {es} {93}
  global {fsBox}
  set {fsBox(activeBackground)} {}
  set {fsBox(activeForeground)} {}
  set {fsBox(all)} {0}
  set {fsBox(background)} {}
  set {fsBox(button)} {0}
  set {fsBox(extensions)} {0}
  set {fsBox(font)} {}
  set {fsBox(foreground)} {}
  set {fsBox(internalPath)} {/usr/home/heller/Deepwoods/RolePlaying}
  set {fsBox(name)} {}
  set {fsBox(path)} {/usr/home/heller/Deepwoods/RolePlaying}
  set {fsBox(pattern)} {*}
  set {fsBox(scrollActiveForeground)} {}
  set {fsBox(scrollBackground)} {}
  set {fsBox(scrollForeground)} {}
  set {fsBox(scrollSide)} {left}
  set {fsBox(showPixmap)} {0}
  global {inputBox}
  set {inputBox(activeBackground)} {}
  set {inputBox(activeForeground)} {}
  set {inputBox(anchor)} {n}
  set {inputBox(background)} {}
  set {inputBox(erase)} {1}
  set {inputBox(font)} {}
  set {inputBox(foreground)} {}
  set {inputBox(justify)} {center}
  set {inputBox(scrollActiveForeground)} {}
  set {inputBox(scrollBackground)} {}
  set {inputBox(scrollForeground)} {}
  set {inputBox(scrollSide)} {left}
  set {inputBox(toplevelName)} {.inputBox}
  global {textBox}
  set {textBox(activeBackground)} {}
  set {textBox(activeForeground)} {}
  set {textBox(background)} {}
  set {textBox(button)} {0}
  set {textBox(contents)} {}
  set {textBox(font)} {}
  set {textBox(foreground)} {}
  set {textBox(scrollActiveForeground)} {}
  set {textBox(scrollBackground)} {}
  set {textBox(scrollForeground)} {}
  set {textBox(scrollSide)} {left}
  set {textBox(state)} {disabled}
  set {textBox(toplevelName)} {.textBox}
  global {tmplt}
  set {tmplt} {0}
  global {yesNoBox}
  set {yesNoBox(activeBackground)} {}
  set {yesNoBox(activeForeground)} {}
  set {yesNoBox(afterNo)} {0}
  set {yesNoBox(afterYes)} {0}
  set {yesNoBox(anchor)} {n}
  set {yesNoBox(background)} {}
  set {yesNoBox(button)} {0}
  set {yesNoBox(font)} {*times-bold-r-normal*24*}
  set {yesNoBox(foreground)} {}
  set {yesNoBox(justify)} {center}
  global {tkiEmbed}
  set {tkiEmbed} {1}

  # please don't modify the following
  # variables. They are needed by xf.
  global {autoLoadList}
  set {autoLoadList(CHARFunctions)} {1}
  set {autoLoadList(CLFunctions)} {1}
  set {autoLoadList(EMFunctions)} {0}
  set {autoLoadList(MASTERFunctions)} {1}
  set {autoLoadList(MONSTFunctions)} {1}
  set {autoLoadList(PrintFunctions)} {1}
  set {autoLoadList(RolePlayingDB)} {0}
  set {autoLoadList(SYSFunctions)} {0}
  set {autoLoadList(HELPFunctions)} {1}
  set {autoLoadList(searchbox.tcl)} {1}
  set {autoLoadList(topgetopt.tcl)} {1}
  set {autoLoadList(tkinfo.tcl)} {1}
  global {internalAliasList}
  set {internalAliasList} {}
  global {moduleList}
  set {moduleList(CHARFunctions)} { AdvanceCharacterLevel ShowWindow.top10 ReRollCharacter ResetCharacterForm RollCharacter RollCharacterCancel RollCharacterHelp RollCharacterOk UpdateCharacter}
  set {moduleList(CLFunctions)} { CLBind CLDelete CLDelete1 CLGet CLFind CLInsert CLInsert1 CLMoveDown CLMoveUp CLNearest CLNearestTag CLSingleSelect CLSize}
  set {moduleList(EMFunctions)} { EMBackwardCharacter EMBackwardWord EMBeginFile EMBeginLine EMCopyRegion EMDeleteNextChar EMDeleteNextWord EMDeletePrevChar EMDeletePrevWord EMEndFile EMEndLine EMForwardCharacter EMForwardWord EMGotoMark EMHandleTab EMKill EMKillRegion EMNewLine EMNewLineAndIndent EMNextLine EMNextPage EMNop EMOpenLine EMPrevLine EMPrevPage EMPutSelection EMRefresh EMRemoveMark EMScrollLine EMScrollLineBack EMSelfInsert EMSetMark EMSwap EMTextBind EMTransposeCharacters EMYank}
  set {moduleList(MASTERFunctions)} { Center Down DownLeft DownRight Left MasterChangeMode MasterSubSubModeChange Move Up UpLeft UpRight Right MasterAddCharacter MasterRemoveCharacter MasterAddCombatant MasterGoto MasterMeleeDamage MasterMeleeHit MasterNextMeleeRound MasterSelectAttacker MasterSelectDefender MasterViewCharacter MasterInsertMarchIcon MasterRemoveMarchIcon MasterMarchIconSelect MasterAddTrick MasterRemoveTrick MasterViewTrick MasterAddOther MasterRemoveOther MasterViewOther MasterAddTreasure MasterRemoveTreasure MasterViewTreasure MasterAddMonster MasterRemoveMonster MasterViewMonster DescribeBitMap MoveDrag MoveEnd MoveStart CheckMasterMode MasterCreateNewTreasure MasterCreateNewTrick MasterCreateTrickTreasureFormReset MasterCreateMonster MasterCreateNPC MasterNewFrame MasterOpenFrame MasterSaveFrame MasterSaveFrameAs MasterInstallDoors MasterResetDoors MasterAddSpace MasterRemoveSpace MasterUpdateSpace MasterEditDungeonComments MasterEditGameNotes MasterDrawSpaceExits MasterExitButtonSet MasterExitButtonGet MasterAddEncumbrence MasterRemoveEncumbrence}
  set {moduleList(MONSTFunctions)} { UpdateMonster ResetMonsterForm}
  set {moduleList(PrintFunctions)} { ShowWindow.top11 PrintFormCancel PrintFormHelp PrintFormPrint PrintFrame}
  set {moduleList(RolePlayingDB)} {}
  set {moduleList(SYSFunctions)} { AlertBox AlertBoxFd AlertBoxFile AlertBoxInternal Alias FSBox FSBoxBindSelectOne FSBoxFSFileSelect FSBoxFSFileSelectDouble FSBoxFSInsertPath FSBoxFSNameComplete FSBoxFSShow GetSelection HistoryTextBox InputBoxInternal InputBoxMulti InputBoxOne IsADir IsAFile IsASymlink TextBox TextBoxFd TextBoxFile TextBoxInternal VersionAlertBox YesNoBox Unalias ColorBox}
  set {moduleList(HELPFunctions)} {PopupHelpTopic PopupHelpWidget}
  set {moduleList(searchbox.tcl)} {searchboxSearch searchboxNext searchboxKeyNav searchboxSaveConfig TextSearch regexpTextSearch}
  set {moduleList(topgetopt.tcl)} {topgetopt}
  set {moduleList(tkinfo.tcl)} {tkiInfo tkiAddInfoPaths tkiGetAndDisplay}
  global {preloadList}
  set {preloadList(xfInternal)} {}
  global {symbolicName}
  set {symbolicName(CharacterAge)} {.frame3.frame7.entry20}
  set {symbolicName(CharacterAlignment)} {.frame3.frame2.entry20}
  set {symbolicName(CharacterChrisma)} {.frame3.frame3.frame5.frame10.entry16}
  set {symbolicName(CharacterClass)} {.frame3.frame24.entry28}
  set {symbolicName(CharacterCommentary)} {.frame3.frame.text2}
  set {symbolicName(CharacterConstitution)} {.frame3.frame3.frame5.frame9.entry14}
  set {symbolicName(CharacterDexterity)} {.frame3.frame3.frame5.frame8.entry12}
  set {symbolicName(CharacterEStrength)} {.frame3.frame3.frame4.frame5.entry3}
  set {symbolicName(CharacterExperiencePoints)} {.frame3.frame0.entry3}
  set {symbolicName(CharacterFrame)} {.frame3}
  set {symbolicName(CharacterHitPoints)} {.frame3.frame24.label7}
  set {symbolicName(CharacterIntelligence)} {.frame3.frame3.frame4.frame7.entry3}
  set {symbolicName(CharacterLevel)} {.frame3.frame1.label5}
  set {symbolicName(CharacterName)} {.frame3.frame17.entry20}
  set {symbolicName(CharacterPlayer)} {.frame3.frame18.entry22}
  set {symbolicName(CharacterRace)} {.frame3.frame23.entry22}
  set {symbolicName(CharacterSex)} {.frame3.frame5.entry20}
  set {symbolicName(CharacterStrength)} {.frame3.frame3.frame4.frame5.entry2}
  set {symbolicName(CharacterWisdom)} {.frame3.frame3.frame4.frame6.entry4}
  set {symbolicName(MasterAddCharacterButton)} {.frame8.frame16.frame2.frame12.button1}
  set {symbolicName(MasterAddEncumbrenceButton)} {.frame8.frame16.frame2.frame12.button14}
  set {symbolicName(MasterBuildMode)} {.frame8.frame1.radiobutton3}
  set {symbolicName(MasterCharacterList)} {.frame8.frame16.frame1.canvas2}
  set {symbolicName(MasterCreateSubMode)} {.frame8.frame1.radiobutton1}
  set {symbolicName(MasterCreateSubModeFrame)} {.frame8.frame4.frame0.frame1.frame3}
  set {symbolicName(MasterCreateTrickTreasureDescription)} {.frame8.frame4.frame0.frame1.frame3.descrFrame.entry19}
  set {symbolicName(MasterCreateTrickTreasureEPValue)} {.frame8.frame4.frame0.frame1.frame3.epFrame.entry15}
  set {symbolicName(MasterCreateTrickTreasureIsUniqueButton)} {.frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.checkbutton22}
  set {symbolicName(MasterCreateTrickTreasureName)} {.frame8.frame4.frame0.frame1.frame3.nameFrame.entry13}
  set {symbolicName(MasterCreateTrickTreasureType)} {.frame8.frame4.frame0.frame1.frame3.typeFrame.entry17}
  set {symbolicName(MasterCreateTrickTreasureValue)} {.frame8.frame4.frame0.frame1.frame3.valueUniqueFrame.entry21}
  set {symbolicName(MasterExitsSubMode)} {.frame8.frame1.radiobutton9}
  set {symbolicName(MasterExitsSubModeFrame)} {.frame8.frame4.frame0.frame1.frame2}
  set {symbolicName(MasterExitsSubModeSpace)} {.frame8.frame4.frame0.frame1.frame2.space}
  set {symbolicName(MasterCurrentMeleeRound)} {.frame8.frame4.frame0.frame1.frame1.frame2.frame11.label13}
  set {symbolicName(MasterDiceND)} {.frame8.frame5.entry7}
  set {symbolicName(MasterDiceNS)} {.frame8.frame5.entry9}
  set {symbolicName(MasterDiceRoll)} {.frame8.frame5.label11}
  set {symbolicName(MasterFrame)} {.frame8}
  set {symbolicName(MasterListEncumbrencesButton)} {.frame8.frame16.frame2.frame12.button16}
  set {symbolicName(MasterLocationLevel)} {.frame8.frame3.entry6}
  set {symbolicName(MasterLocationX)} {.frame8.frame3.entry7}
  set {symbolicName(MasterLocationY)} {.frame8.frame3.entry8}
  set {symbolicName(MasterMarchCanvas)} {.frame8.frame16.frame0.canvas2}
  set {symbolicName(MasterMeleeCombatants)} {.frame8.frame4.frame0.frame1.frame1.frame0.canvas2}
  set {symbolicName(MasterMeleeDamageND)} {.frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry7}
  set {symbolicName(MasterMeleeDamageNS)} {.frame8.frame4.frame0.frame1.frame1.frame2.frame10.entry9}
  set {symbolicName(MasterMeleeDamageValue)} {.frame8.frame4.frame0.frame1.frame1.frame2.frame10.label9}
  set {symbolicName(MasterMeleeHitND)} {.frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry7}
  set {symbolicName(MasterMeleeHitNS)} {.frame8.frame4.frame0.frame1.frame1.frame2.frame5.entry9}
  set {symbolicName(MasterMeleeHitValue)} {.frame8.frame4.frame0.frame1.frame1.frame2.frame5.label9}
  set {symbolicName(MasterMeleeSubMode)} {.frame8.frame1.radiobutton0}
  set {symbolicName(MasterMeleeSubModeFrame)} {.frame8.frame4.frame0.frame1.frame1}
  set {symbolicName(MasterMonstersList)} {.frame8.frame4.frame0.frame1.frame9.frame0.canvas2}
  set {symbolicName(MasterMonstersSubMode)} {.frame8.frame1.radiobutton2}
  set {symbolicName(MasterMonstersSubModeFrame)} {.frame8.frame4.frame0.frame1.frame9}
  set {symbolicName(MasterMonstersSubModeFrameAdd)} {.frame8.frame4.frame0.frame1.frame9.frame14.button15}
  set {symbolicName(MasterMonstersSubModeFrameRemove)} {.frame8.frame4.frame0.frame1.frame9.frame14.button16}
  set {symbolicName(MasterMonstersSubModeFrameCreateMonster)} {.frame8.frame4.frame0.frame1.frame9.frame14.button18}
  set {symbolicName(MasterMonstersSubModeFrameCreateNPC)} {.frame8.frame4.frame0.frame1.frame9.frame14.button19}
  set {symbolicName(MasterOtherList)} {.frame8.frame4.frame0.frame1.frame13.frame0.canvas2}
  set {symbolicName(MasterOtherSubMode)} {.frame8.frame1.radiobutton8}
  set {symbolicName(MasterOtherSubModeFrame)} {.frame8.frame4.frame0.frame1.frame13}
  set {symbolicName(MasterOtherSubModeFrameAdd)} {.frame8.frame4.frame0.frame1.frame13.frame17.button15}
  set {symbolicName(MasterOtherSubModeFrameRemove)} {.frame8.frame4.frame0.frame1.frame13.frame17.button16}
  set {symbolicName(MasterPlayMode)} {.frame8.frame1.radiobutton4}
  set {symbolicName(MasterRemoveCharacterButton)} {.frame8.frame16.frame2.frame12.button2}
  set {symbolicName(MasterRemoveEncumbrenceButton)} {.frame8.frame16.frame2.frame12.button15}
  set {symbolicName(MasterSpace-1-1)} {.frame8.frame4.frame2.frame3.frame6.canvas15}
  set {symbolicName(MasterSpace-10)} {.frame8.frame4.frame2.frame4.frame9.canvas15}
  set {symbolicName(MasterSpace-11)} {.frame8.frame4.frame2.frame5.frame12.canvas15}
  set {symbolicName(MasterSpace0-1)} {.frame8.frame4.frame2.frame3.frame7.canvas15}
  set {symbolicName(MasterSpace00)} {.frame8.frame4.frame2.frame4.frame10.canvas15}
  set {symbolicName(MasterSpace01)} {.frame8.frame4.frame2.frame5.frame13.canvas15}
  set {symbolicName(MasterSpace1-1)} {.frame8.frame4.frame2.frame3.frame8.canvas15}
  set {symbolicName(MasterSpace10)} {.frame8.frame4.frame2.frame4.frame11.canvas15}
  set {symbolicName(MasterSpace11)} {.frame8.frame4.frame2.frame5.frame14.canvas15}
  set {symbolicName(MasterSpaceButtons)} {.frame8.frame4.frame0.spacebuttons}
  set {symbolicName(MasterSquareComments)} {.frame8.frame4.frame0.frame.text2}
  set {symbolicName(MasterSubSubFrame)} {.frame8.frame4.frame0.frame1}
  set {symbolicName(MasterTreasureList)} {.frame8.frame4.frame0.frame1.frame11.frame0.canvas2}
  set {symbolicName(MasterTreasureSubMode)} {.frame8.frame1.radiobutton7}
  set {symbolicName(MasterTreasureSubModeFrame)} {.frame8.frame4.frame0.frame1.frame11}
  set {symbolicName(MasterTreasureSubModeFrameAdd)} {.frame8.frame4.frame0.frame1.frame11.frame17.button15}
  set {symbolicName(MasterTreasureSubModeFrameRemove)} {.frame8.frame4.frame0.frame1.frame11.frame17.button16}
  set {symbolicName(MasterTrickList)} {.frame8.frame4.frame0.frame1.frame10.frame0.canvas2}
  set {symbolicName(MasterTricksSubMode)} {.frame8.frame1.radiobutton5}
  set {symbolicName(MasterTricksSubModeFrame)} {.frame8.frame4.frame0.frame1.frame10}
  set {symbolicName(MasterTricksSubModeFrameAdd)} {.frame8.frame4.frame0.frame1.frame10.frame14.button15}
  set {symbolicName(MasterTricksSubModeFrameRemove)} {.frame8.frame4.frame0.frame1.frame10.frame14.button16}
  set {symbolicName(MonsterAlignment)} {.frame7.frame0.frame42.entry23}
  set {symbolicName(MonsterArmorClass)} {.frame7.frame0.frame4.entry23}
  set {symbolicName(MonsterComments)} {.frame7.frame.text2}
  set {symbolicName(MonsterDamPerAttack)} {.frame7.frame0.frame37.entry23}
  set {symbolicName(MonsterFrame)} {.frame7}
  set {symbolicName(MonsterFrequency)} {.frame7.frame0.frame2.entry19}
  set {symbolicName(MonsterHitDiceND)} {.frame7.frame0.frame26.frame27.entry30}
  set {symbolicName(MonsterHitDiceNS)} {.frame7.frame0.frame26.frame27.entry32}
  set {symbolicName(MonsterHitDiceR)} {.frame7.frame0.frame26.frame27.radiobutton29}
  set {symbolicName(MonsterHitPoints)} {.frame7.frame0.frame26.frame28.entry34}
  set {symbolicName(MonsterHitPointsR)} {.frame7.frame0.frame26.frame28.radiobutton33}
  set {symbolicName(MonsterIntelligence)} {.frame7.frame0.frame41.entry23}
  set {symbolicName(MonsterMagicResistance)} {.frame7.frame0.frame40.entry23}
  set {symbolicName(MonsterMove)} {.frame7.frame0.frame24.entry23}
  set {symbolicName(MonsterName)} {.frame7.frame0.frame0.entry2}
  set {symbolicName(MonsterNoAppearing)} {.frame7.frame0.frame3.entry21}
  set {symbolicName(MonsterNoAttacks)} {.frame7.frame0.frame36.entry23}
  set {symbolicName(MonsterPercentInLair)} {.frame7.frame0.frame25.entry23}
  set {symbolicName(MonsterPsionicAbility)} {.frame7.frame0.frame44.entry23}
  set {symbolicName(MonsterSize)} {.frame7.frame0.frame43.entry23}
  set {symbolicName(MonsterSpecialAttacks)} {.frame7.frame0.frame38.entry23}
  set {symbolicName(MonsterSpecialDefences)} {.frame7.frame0.frame39.entry23}
  set {symbolicName(MonsterTreasureType)} {.frame7.frame0.frame35.entry23}
  set {symbolicName(PrintForm)} {.top11}
  set {symbolicName(PrintFormFilename)} {.top11.frame34.frame38.frame40.entry44}
  set {symbolicName(PrintFormMode)} {.top11.frame34.frame0.value}
  set {symbolicName(PrintFormPrinter)} {.top11.frame34.frame38.frame39.entry42}
  set {symbolicName(RollBestOf)} {.top10.frame0.entry8}
  set {symbolicName(RollCharacter)} {.top10}
  set {symbolicName(RollChrisma)} {.top10.frame13.label25}
  set {symbolicName(RollConstitution)} {.top10.frame13.label23}
  set {symbolicName(RollDexterity)} {.top10.frame13.label21}
  set {symbolicName(RollHitDiceSides)} {.top10.frame0.entry3}
  set {symbolicName(RollIntelligence)} {.top10.frame13.label17}
  set {symbolicName(RollMaxHitDice)} {.top10.frame0.entry5}
  set {symbolicName(RollNDice)} {.top10.frame0.entry4}
  set {symbolicName(RollNHitDice)} {.top10.frame0.entry1}
  set {symbolicName(RollNSides)} {.top10.frame0.entry6}
  set {symbolicName(RollStrength)} {.top10.frame13.label15}
  set {symbolicName(RollWisdom)} {.top10.frame13.label19}
  set {symbolicName(descrFrame)} {.frame8.frame4.frame0.frame1.frame3.frame6}
  set {symbolicName(root)} {.}
  set {symbolicName(typeFrame)} {.frame8.frame4.frame0.frame1.frame3.frame5}
  global {xfWmSetPosition}
  set {xfWmSetPosition} {}
  global {xfWmSetSize}
  set {xfWmSetSize} {}
  global {xfAppDefToplevels}
  set {xfAppDefToplevels} {}
}

# initialize global variables
InitGlobals

# display/remove toplevel windows.
ShowWindow.

global xfShowWindow.top10
set xfShowWindow.top10 0

global xfShowWindow.top11
set xfShowWindow.top11 0

# load default bindings.
if {[info exists env(XF_BIND_FILE)] &&
    "[info procs XFShowHelp]" == ""} {
  source $env(XF_BIND_FILE)
}

# parse and apply application defaults.
XFLocalLoadAppDefs RolePlayingDB
XFLocalSetAppDefs

# end source
EndSrc

# eof
#

