grid - 无法通过 GRID 在 TCK/TK 中定位我的标签
问题描述
我在 TCL 中设置了一个 TK 屏幕。第一行的标签和第二行的图像按预期正确设置。但是当我想在图像旁边添加一个标签时,它总是在最右边显示它。我什至使用“nw”锚定标签并将框架也粘贴为“nw”,但行为保持不变。有人可以帮忙吗?
package require Tk
package require Img
wm title . "Operator Login"
# Top corner label
ttk::frame .f0
tk::label .f0.l0 -text "Sales Application" -foreground blue \
-textvariable "Total" -font {Helvetica -18 bold} -anchor ne
# Logo frame
ttk::frame .f1
tk::label .f1.l0 -textvariable "Total" -anchor nw
image create photo imgobj -file "C:/.../.../flowers.bmp"
.f1.l0 configure -image imgobj
# Login frame
ttk::frame .f2
tk::label .f2.l0 -text "ID " -foreground blue -textvariable "ID" \
-font {Helvetica -13 bold} -anchor nw
# GRID Management
grid .f0 -column 0 -row 0 -columnspan 25 -sticky ne
grid .f0.l0 -column 0 -row 0 -columnspan 25
grid .f1 -column 0 -row 2 -columnspan 4 -rowspan 5 -sticky nsew -pady 5 -padx 5
grid .f1.l0 -column 0 -row 2 -columnspan 4 -rowspan 5 -sticky nsew -pady 5 -padx 5
grid .f2 -column 5 -row 2 -sticky w
grid .f2.l0 -column 5 -row 2
grid columnconfigure . 0 -weight 1
grid columnconfigure .f1 0 -weight 1
grid rowconfigure .f1 0 -weight 1
解决方案
推荐阅读
- javascript - 如何从“联系我们”表单网站向 Gmail 帐户发送电子邮件
- python - 交叉验证不一致的样本数错误(Python)
- javascript - GraphQL:TypeError:无法读取未定义的属性
- python - Windows 中 wlan 的 Subprocess.check_output 的 CalledProcessError
- php - PHP 上的 MySQL 需要 2 次重新加载来更新值
- android - 数据库更改时 UI 不更新
- python - MacBook:操作系统更新后无法启动 jupyter notebook
- ffmpeg - 下载youtube视频时ffmpeg“清单太大”
- python - 在 Python 中计算子网的地址
- python - 如何从生成的列表数据中制作熊猫数据框