This is an empty page. Enter page contents here, upload content using the button above, or click cancel to leave it empty. <>Enter Category Here wm title . NBA_NETS labelframe .top -text "輸入球員今日比賽統計值" -relief groove -labelanchor n labelframe .t -text "火箭隊先發球員表現比較圖" -relief groove -labelanchor n frame .top.a -bg hotpink frame .top.b frame .top.c frame .top.d frame .top.e frame .top.f frame .top.g #entry .t.a.z -width 42 -relief sunken -textvariable zz canvas .t.c -bg linen; pack .t.c foreach {icon data} { folder {R0lGODlhEAAMAKEAAAD//wAAAPD/gAAAACH5\ BAEAAAAALAAAAAAQAAwAAAIghINhyycvVFsB\ QtmS3rjaH1Hg141WaT5ouprt2HHcUgAAOw==} file {R0lGODlhDAAMAKEAALLA3AAAAP//8wAAACH5\ BAEAAAAALAAAAAAMAAwAAAIgRI4Ha+IfWHsO\ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==} } { set $icon [image create photo -data $data] } button .t.a -text "今日球員" -compound left -image $file -command { .t.c create text 100 100 -text [list . Button] } #} #.t.log tag configure highlight -background yellow #} button .top.z -text "儲存今日球員之表現" -compound left -image $folder -command { set mon [string trimleft [clock format [clock seconds] -format "%m" ] 0] set day [string trimleft [clock format [clock seconds] -format "%d" ] 0] set count [expr ($mon-2)*28+$day] foreach {ab} {aa1 aa2 aa3 bb1 bb2 bb3 cc1 cc2 cc3 dd1 dd2 dd3 ee1 ee2 ee3 ff1 ff2 ff3} {if {[set $ab]==""} {set $ab 0}} set fi ""; set all "" foreach {a b c} {aa1 aa2 aa3 bb1 bb2 bb3 cc1 cc2 cc3 dd1 dd2 dd3 ee1 ee2 ee3 ff1 ff2 ff3} {set a [set $a]; set b [set $b]; set c [set $c]; lappend all $a $b $c |; lappend fi [expr $a+$b+$c]} set hand [open record.txt a] puts $hand "$fi [list $all] $count" close $hand draw } image create photo aaa -file Nets.gif label .top.a.a -image aaa label .top.a.l -text "得分 籃板 助攻" -padx 0 -fg pink -bg gray40 pack .top.a.a -side left pack .top.a.l -side bottom label .top.b.l -text 中鋒_好沃爾 -padx 0 -fg red pack .top.b.l -side left foreach no {3 2 1} { entry .top.b.cmd$no -width 20 -relief sunken -width 5 -textvariable aa$no pack .top.b.cmd$no -side right -fill x } focus .top.b.cmd1 label .top.c.l -text 大前_帕生斯 -padx 0 -fg orange pack .top.c.l -side left foreach no {3 2 1} { entry .top.c.cmd$no -width 20 -relief sunken -width 5 -textvariable bb$no pack .top.c.cmd$no -side right -fill x } label .top.d.l -text 小前_卡斯皮 -padx 0 -fg yellow -bg darkred pack .top.d.l -side left foreach no {3 2 1} { entry .top.d.cmd$no -width 20 -relief sunken -width 5 -textvariable cc$no pack .top.d.cmd$no -side right -fill x } label .top.e.l -text 得衛_哈哈登 -padx 0 -fg green pack .top.e.l -side left foreach no {3 2 1} { entry .top.e.cmd$no -width 20 -relief sunken -width 5 -textvariable dd$no pack .top.e.cmd$no -side right -fill x } label .top.f.l -text 得衛_甲西亞 -padx 0 -fg blue pack .top.f.l -side left foreach no {3 2 1} { entry .top.f.cmd$no -width 20 -relief sunken -width 5 -textvariable ee$no pack .top.f.cmd$no -side right -fill x } label .top.g.l -text 控衛_林書豪 -padx 0 -fg pink -bg darkred pack .top.g.l -side left foreach no {3 2 1} { entry .top.g.cmd$no -width 20 -relief sunken -width 5 -textvariable ff$no pack .top.g.cmd$no -side right -fill x } pack .top.z .top.a .top.b .top.c .top.d .top.e .top.f .top.g -side top -fill x -expand true if {![file exists record.txt]} {close [open record.txt w]} set hand [open record.txt r]; while {[gets $hand li]>-1} {if {$li!=""} {set line $li}}; close $hand if {[info exists line]} { set finall [lindex $line end] set mon [string trimleft [clock format [clock seconds] -format "%m" ] 0] set day [string trimleft [clock format [clock seconds] -format "%d" ] 0] set count [expr ($mon-2)*28+$day] if {$count==$finall} {pack forget .top.z} } #pack .t.a -side left #pack .t.a.set -side right #pack .t.a .t.log -side top -fill x -expand true #focus .top.b.cmd1 pack .top .t -side left -fill both -expand true foreach no {1 2 3} { if {$no!=3} {bind .top.b.cmd$no "focus .top.b.cmd[expr $no+1]" } else {bind .top.b.cmd$no "focus .top.c.cmd1"} } foreach no {1 2 3} { if {$no!=3} {bind .top.c.cmd$no "focus .top.c.cmd[expr $no+1]" } else {bind .top.c.cmd$no "focus .top.d.cmd1"} } foreach no {1 2 3} { if {$no!=3} {bind .top.d.cmd$no "focus .top.d.cmd[expr $no+1]" } else {bind .top.d.cmd$no "focus .top.e.cmd1"} } foreach no {1 2 3} { if {$no!=3} {bind .top.e.cmd$no "focus .top.e.cmd[expr $no+1]" } else {bind .top.e.cmd$no "focus .top.f.cmd1"} } foreach no {1 2 3} { if {$no!=3} {bind .top.f.cmd$no "focus .top.f.cmd[expr $no+1]" } else {bind .top.f.cmd$no "focus .top.g.cmd1"} } foreach no {1 2 3} { if {$no!=3} {bind .top.g.cmd$no "focus .top.g.cmd[expr $no+1]" } else {bind .top.g.cmd$no ".top.z invoke"} } if {[info exists line]} {if {$count==$finall} {bind .top.f.cmd3 {}}} proc draw {} { .t.c delete aa #update; after 100 set red ""; set orange ""; set yellow ""; set green ""; set blue ""; set pink "" set hand [open record.txt r] while {[gets $hand line] > -1} { set da [lindex $line end] set a [lindex $line 0]; set b [lindex $line 1]; set c [lindex $line 2]; set d [lindex $line 3]; set e [lindex $line 4]; set f [lindex $line 5] lappend red [expr $da*5] [expr 250-5*$a]; lappend orange [expr $da*5] [expr 250-5*$b]; lappend yellow [expr $da*5] [expr 250-5*$c]; lappend green [expr $da*5] [expr 250-5*$d]; lappend blue [expr $da*5] [expr 250-5*$e]; lappend pink [expr $da*5] [expr 250-5*$f] .t.c create rect [expr 5*$da] [expr 250-5*$a] [expr 5*$da+3] [expr 250-5*$a+3] -fill red -tag aa .t.c create rect [expr 5*$da] [expr 250-5*$b] [expr 5*$da+3] [expr 250-5*$b+3] -fill orange -tag aa .t.c create rect [expr 5*$da] [expr 250-5*$c] [expr 5*$da+3] [expr 250-5*$c+3] -fill yellow -tag aa .t.c create rect [expr 5*$da] [expr 250-5*$d] [expr 5*$da+3] [expr 250-5*$d+3] -fill green -tag aa .t.c create rect [expr 5*$da] [expr 250-5*$e] [expr 5*$da+3] [expr 250-5*$e+3] -fill blue -tag aa .t.c create rect [expr 5*$da] [expr 250-5*$f] [expr 5*$da+3] [expr 250-5*$f+3] -fill pink -tag aa } if {[llength $red]>2} {.t.c create line $red -fill red -tag aa} if {[llength $red]>2} {.t.c create line $orange -fill orange -tag aa} if {[llength $red]>2} {.t.c create line $green -fill green -tag aa} if {[llength $red]>2} {.t.c create line $yellow -fill yellow -tag aa} if {[llength $red]>2} {.t.c create line $blue -fill blue -tag aa} if {[llength $red]>2} {.t.c create line $pink -fill pink -tag aa} close $hand } draw wm resizable . 0 0 wm withdraw . update #set x [expr {([winfo screenwidth .]-[winfo width .])/2}] #set y [expr {([winfo screenheight .]-[winfo height .])/2}] wm geometry . -50-50 wm deiconify .