#!/usr/bin/wish

########### ɥ礭 ##########################

. configure -width 500 -height 290


########### ʸ ######################################

label .text1 -text "ưץΥܥ1󲡤Ƥ"
label .text2 -text "ƱưΤϣ٤ˤƤ"


###########סֽλץܥ #######################

frame .footnote
button .explanation -text "" -command {
  toplevel .dialog
  text .dialog.text -width 80 -height 20 -yscrollcommand ".dialog.bar set"
  scrollbar .dialog.bar -orient vertical -command ".dialog.text yview"
  button .dialog.quit -text "Ĥ" -command "destroy .dialog"
  set file [open "./README"]
  while {[gets $file line]>=0} {.dialog.text insert end $line\n}
  grid .dialog.text -row 1 -column 0 -sticky nsew
  grid .dialog.bar -row 1 -column 1 -sticky ns
  grid .dialog.quit -row 2 -column 0 -sticky ns
  close $file
}

button .quit -text "λ" -command { exit }


############## ɲäϰʲ˽񤭲ä #########################
#                                                                           #
# button .ܥ̾ -text "٥" -command { exec "¹Ԥ륳ޥ" &} #
#                                                                           #
#############################################################################

frame  .frame1 -highlightbackground red -highlightcolor green -borderwidth 2 
frame  .frame2 -borderwidth 2 
frame  .frame3 -borderwidth 2 

label .title1 -text \
"\n================== ʬ ==================="
button .button100 -text "FitzHughNagmo" -command { exec "./FitzHughNagumo" &}
button .button101 -text "KeenerTyson"   -command { exec "./KeenerTyson" & }
button .button102 -text "Parametric"    -command { exec "./Parametric" & }
button .button103 -text "VanderPol"     -command { exec "./VanderPol" & }
button .button104 -text "Rossler"       -command { exec "./Rossler" & }
button .button105 -text "Lorenz"        -command { exec "./Lorenz" & }
button .button106 -text "GCGL"          -command { exec "./GCGL" & }
button .button107 -text "swarms"        -command { exec "./swarms" & }


label .title2 -text \
"\n================== ʬ ==================="
button .button200 -text "CGL"          -command { exec "./CGL" & }
button .button201 -text "CGL_1d"       -command { exec "./CGL_1d" & }
button .button202 -text "GP"           -command { exec "./GP" & }
button .button203 -text "NW"           -command { exec "./NW" & }
button .button204 -text "bistable"     -command { exec "./bistable" & }
button .button205 -text "excitable"    -command { exec "./excitable" & }
button .button206 -text "excitable_1d" -command { exec "./excitable_1d" & }
button .button207 -text "PhaseField"   -command { exec "./PhaseField" & }
button .button208 -text "SnowCrystal"  -command { exec "./SnowCrystal" & }
button .button209 -text "KS_1d"        -command { exec "./KS_1d" & }
button .button210 -text "Schrodinger"  -command { exec "./xtoys/schrodinger" & }
button .button211 -text "Wave"          -command { exec "./xtoys/xwaves" & }


label .title3 -text \
"\n================== ȥޥȥ ==================="
button .button300 -text "DLA"       -command { exec "./DLA" & }
button .button301 -text "Ising"     -command { exec "./xtoys/xising" & }
button .button302 -text "automaton" -command { exec "./xtoys/xautomalab" & }
button .button303 -text "Potts"     -command { exec "./xtoys/xpotts" & }
button .button304 -text "sandpile"  -command { exec "./xtoys/xsand" & }
button .button305 -text "xfires"    -command { exec "./xtoys/xfires" & }


label .title4 -text ""



########################## ܥʸϤ ###############################
#                                                                           #
# place .ܥ̾ -x xɸ -y yɸ                                     #
#                                                                           #
#############################################################################

grid .explanation -in .footnote -row 1 -column 0 -sticky ns
grid .quit        -in .footnote -row 1 -column 1 -sticky ns
#place .explanation -x 150 -y 60
#place .quit        -x 240 -y 60

grid .button100 -in .frame1 -row 1 -column 0 -sticky nsw 
grid .button101 -in .frame1 -row 1 -column 1 -sticky nsw 
grid .button102 -in .frame1 -row 1 -column 2 -sticky nsw
grid .button103 -in .frame1 -row 1 -column 3 -sticky nsw
grid .button104 -in .frame1 -row 2 -column 0 -sticky nsw
grid .button105 -in .frame1 -row 2 -column 1 -sticky nsw
grid .button106 -in .frame1 -row 2 -column 2 -sticky nsw
grid .button107 -in .frame1 -row 2 -column 3 -sticky nsw

grid .button200 -in .frame2 -row 1 -column 0 -sticky nsw
grid .button201 -in .frame2 -row 1 -column 1 -sticky nsw
grid .button202 -in .frame2 -row 1 -column 2 -sticky nsw
grid .button203 -in .frame2 -row 1 -column 3 -sticky nsw
grid .button204 -in .frame2 -row 2 -column 0 -sticky nsw
grid .button205 -in .frame2 -row 2 -column 1 -sticky nsw
grid .button206 -in .frame2 -row 2 -column 2 -sticky nsw
grid .button207 -in .frame2 -row 2 -column 3 -sticky nsw
grid .button208 -in .frame2 -row 3 -column 0 -sticky nsw
grid .button209 -in .frame2 -row 3 -column 1 -sticky nsw
grid .button210 -in .frame2 -row 3 -column 2 -sticky nsw
grid .button211 -in .frame2 -row 3 -column 3 -sticky nsw

grid .button300 -in .frame3 -row 1 -column 0 -sticky nsw
grid .button301 -in .frame3 -row 1 -column 1 -sticky nsw
grid .button302 -in .frame3 -row 1 -column 2 -sticky nsw
grid .button303 -in .frame3 -row 1 -column 3 -sticky nsw
grid .button304 -in .frame3 -row 2 -column 0 -sticky nsw
grid .button305 -in .frame3 -row 2 -column 1 -sticky nsw

grid .text1  -row 1
grid .text2  -row 2

grid .title1  -row 3
grid .frame1  -row 4

grid .title2  -row 5
grid .frame2  -row 6

grid .title3  -row 7
grid .frame3  -row 8

grid .title4  -row 9
grid .footnote -row 10

#grid .text1  -x 10  -y 10
#grid .text2   -x 10  -y 30
#place .frame0  -x  10 -y 120





