@飞觞醉月 问起这个问题。
proc wm_center {win} { set w [winfo width $win] set h [winfo height $win] set W [winfo screenwidth .] set H [winfo screenheight .] set x [expr {($W-$w)>>1}] set y [expr {($H-$h)>>1}] wm geometry $win +$x+$y }