【tcltk - tk】 proc gridLite

梦想的初衷 提交于 2020-02-01 22:33:46

参数说明:

  • 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

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!