参数说明:
- w -- pathName
- in -- grid 的 -in,取值 - 表示不配置
- r, c -- grid 的 -row 和 -column
- s -- grid 的 -sticky,取值 - 表示,不配置,取值 x 表示 nsew
- rs, cs -- grid 的 -rowspan 和 -columnspan
- rw, cw -- grid 的 columnconfigure index -weight 和 rowconfigure index -weight,取值表示 inde 时表示 -weight yes,取值 - 表示不配置
proc gridLite {w in r c {s -} {rs 1} {cs 1} {rw -} {cw -}} { if {$in eq {-}} {winfo parent $w} switch -- $s - {set s {} } x {set s {-sticky nsew} } default {set s "-sticky $s"} grid $w -in $in -column $c -row $r {*}$s -columnspan $cs -rowspan $rs if {[string is digit -strict $rw]} {grid rowcon $in $rw -weight 1} if {[string is digit -strict $cw]} {grid column $in $cw -weight 1} return }gridLite .text - 1 1 x 1 1 1 1
来源:https://www.cnblogs.com/GCxokoA/p/12250220.html